12 lines
669 B
MySQL
12 lines
669 B
MySQL
|
|
CREATE TABLE "form_templates" (
|
||
|
|
"id" text PRIMARY KEY NOT NULL,
|
||
|
|
"name" text NOT NULL,
|
||
|
|
"filename" text NOT NULL,
|
||
|
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||
|
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||
|
|
CONSTRAINT "form_templates_filename_unique" UNIQUE("filename")
|
||
|
|
);
|
||
|
|
--> statement-breakpoint
|
||
|
|
ALTER TABLE "documents" ADD COLUMN "form_template_id" text;--> statement-breakpoint
|
||
|
|
ALTER TABLE "documents" ADD COLUMN "file_path" text;--> statement-breakpoint
|
||
|
|
ALTER TABLE "documents" ADD CONSTRAINT "documents_form_template_id_form_templates_id_fk" FOREIGN KEY ("form_template_id") REFERENCES "public"."form_templates"("id") ON DELETE no action ON UPDATE no action;
|