Skip to content

Commit 8899794

Browse files
committed
feat(form): added migrations
1 parent f65263e commit 8899794

File tree

3 files changed

+9769
-0
lines changed

3 files changed

+9769
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
CREATE TABLE "form" (
2+
"id" text PRIMARY KEY NOT NULL,
3+
"workflow_id" text NOT NULL,
4+
"user_id" text NOT NULL,
5+
"identifier" text NOT NULL,
6+
"title" text NOT NULL,
7+
"description" text,
8+
"is_active" boolean DEFAULT true NOT NULL,
9+
"customizations" json DEFAULT '{}',
10+
"auth_type" text DEFAULT 'public' NOT NULL,
11+
"password" text,
12+
"allowed_emails" json DEFAULT '[]',
13+
"show_branding" boolean DEFAULT true NOT NULL,
14+
"created_at" timestamp DEFAULT now() NOT NULL,
15+
"updated_at" timestamp DEFAULT now() NOT NULL
16+
);
17+
--> statement-breakpoint
18+
ALTER TABLE "form" ADD CONSTRAINT "form_workflow_id_workflow_id_fk" FOREIGN KEY ("workflow_id") REFERENCES "public"."workflow"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
19+
ALTER TABLE "form" ADD CONSTRAINT "form_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
20+
CREATE UNIQUE INDEX "form_identifier_idx" ON "form" USING btree ("identifier");--> statement-breakpoint
21+
CREATE INDEX "form_workflow_id_idx" ON "form" USING btree ("workflow_id");--> statement-breakpoint
22+
CREATE INDEX "form_user_id_idx" ON "form" USING btree ("user_id");

0 commit comments

Comments
 (0)