summaryrefslogtreecommitdiff
path: root/db/migrations/0367_foamy_wolfsbane.sql
blob: 8b05537548b75b9478972568f979131d483ccebd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
CREATE TABLE "pcr_pr_attachment" (
	"id" serial PRIMARY KEY NOT NULL,
	"pcr_pr_id" integer NOT NULL,
	"type" varchar(20) NOT NULL,
	"file_name" varchar(255) NOT NULL,
	"file_path" text NOT NULL,
	"file_size" integer,
	"mime_type" varchar(100),
	"created_by" integer,
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_by" integer,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "pcr_pr_attachment" ADD CONSTRAINT "pcr_pr_attachment_pcr_pr_id_pcr_pr_id_fk" FOREIGN KEY ("pcr_pr_id") REFERENCES "public"."pcr_pr"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "pcr_pr_attachment" ADD CONSTRAINT "pcr_pr_attachment_created_by_users_id_fk" FOREIGN KEY ("created_by") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "pcr_pr_attachment" ADD CONSTRAINT "pcr_pr_attachment_updated_by_users_id_fk" FOREIGN KEY ("updated_by") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;