| 1 | CREATE TABLE "user_email" ( |
| 2 | "id" text PRIMARY KEY NOT NULL, |
| 3 | "user_id" text NOT NULL, |
| 4 | "email" text NOT NULL, |
| 5 | "verified" boolean DEFAULT false NOT NULL, |
| 6 | "token" text, |
| 7 | "token_expires_at" timestamp with time zone, |
| 8 | "created_at" timestamp with time zone DEFAULT now() NOT NULL, |
| 9 | CONSTRAINT "user_email_email_unique" UNIQUE("email"), |
| 10 | CONSTRAINT "user_email_token_unique" UNIQUE("token") |
| 11 | ); |
| 12 | --> statement-breakpoint |
| 13 | ALTER TABLE "user_email" ADD CONSTRAINT "user_email_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint |
| 14 | CREATE INDEX "user_email_user_id_idx" ON "user_email" USING btree ("user_id"); |