feat(db): add user bookmark table and migrations

This commit is contained in:
Bima42
2025-11-01 18:27:02 +01:00
parent fd8f0e8f1f
commit 5eef844e5f
2 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
CREATE TABLE IF NOT EXISTS "user_template_bookmarks" (
"id" text PRIMARY KEY NOT NULL,
"userId" text NOT NULL,
"templateId" text NOT NULL,
"createdAt" timestamp DEFAULT now() NOT NULL,
CONSTRAINT "user_template_bookmarks_userId_templateId_unique" UNIQUE("userId","templateId")
);
--> statement-breakpoint
ALTER TABLE "user_template_bookmarks" ADD CONSTRAINT "user_template_bookmarks_userId_user_temp_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user_temp"("id") ON DELETE cascade ON UPDATE no action;