mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
12 lines
505 B
SQL
12 lines
505 B
SQL
CREATE TABLE IF NOT EXISTS "password_reset_tokens" (
|
|
"id" varchar(255) PRIMARY KEY NOT NULL,
|
|
"user_id" varchar(255) NOT NULL,
|
|
"expires_at" timestamp (6) with time zone,
|
|
"created_at" timestamp (6) with time zone DEFAULT now()
|
|
);
|
|
--> statement-breakpoint
|
|
DO $$ BEGIN
|
|
ALTER TABLE "password_reset_tokens" ADD CONSTRAINT "password_reset_tokens_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE cascade ON UPDATE no action;
|
|
EXCEPTION
|
|
WHEN duplicate_object THEN null;
|
|
END $$;
|