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");