Files
scan-receipts/drizzle/0003_flaky_blackheart.sql
Timo 84b9987c49 Add full application: receipt scanning, auth, billing, and account deletion
Brings the working codebase (Next.js app, auth system, Stripe billing,
Docker/deploy config, tests, docs) into version control on top of the
placeholder initial commit, and adds account self-deletion (Danger Zone
in Settings, password + typed-email confirmation, cascading DB cleanup,
Stripe cancellation) per GDPR right-to-erasure.

Excludes local build caches, node_modules, and internal agent scratch
files; .gitignore hardened to keep those out going forward.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-19 20:59:04 +02:00

25 lines
1.5 KiB
SQL

CREATE TABLE "launch_claims" (
"id" varchar(64) PRIMARY KEY NOT NULL,
"user_id" varchar(64) NOT NULL,
"position" integer NOT NULL,
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE TABLE "waitlist" (
"id" varchar(64) PRIMARY KEY NOT NULL,
"email" varchar(255) NOT NULL,
"name" varchar(160),
"source" varchar(100) DEFAULT 'landing_page',
"created_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "users" ADD COLUMN "company" varchar(255);--> statement-breakpoint
ALTER TABLE "users" ADD COLUMN "use_case" varchar(100);--> statement-breakpoint
ALTER TABLE "users" ADD COLUMN "referral_source" varchar(100);--> statement-breakpoint
ALTER TABLE "users" ADD COLUMN "onboarding_completed_at" timestamp;--> statement-breakpoint
ALTER TABLE "users" ADD COLUMN "launch_bonus" boolean DEFAULT false NOT NULL;--> statement-breakpoint
ALTER TABLE "launch_claims" ADD CONSTRAINT "launch_claims_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE UNIQUE INDEX "uq_launch_claims_user_id" ON "launch_claims" USING btree ("user_id");--> statement-breakpoint
CREATE UNIQUE INDEX "uq_launch_claims_position" ON "launch_claims" USING btree ("position");--> statement-breakpoint
CREATE UNIQUE INDEX "uq_waitlist_email" ON "waitlist" USING btree ("email");--> statement-breakpoint
CREATE INDEX "idx_waitlist_created_at" ON "waitlist" USING btree ("created_at");