summaryrefslogtreecommitdiff
path: root/db/migrations/0181_easy_blazing_skull.sql
blob: 9f5c063988253b07d770a7a436c388e611b92798 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
CREATE TABLE "notice" (
	"id" serial PRIMARY KEY NOT NULL,
	"page_path" varchar(100) NOT NULL,
	"title" varchar(500) NOT NULL,
	"content" text NOT NULL,
	"author_id" integer NOT NULL,
	"is_active" boolean DEFAULT true NOT NULL,
	"created_at" timestamp DEFAULT now() NOT NULL,
	"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "page_information" RENAME COLUMN "page_code" TO "page_path";--> statement-breakpoint
ALTER TABLE "page_information" RENAME COLUMN "description" TO "information_content";--> statement-breakpoint
ALTER TABLE "page_information" DROP CONSTRAINT "page_information_page_code_unique";--> statement-breakpoint
ALTER TABLE "notice" ADD CONSTRAINT "notice_author_id_users_id_fk" FOREIGN KEY ("author_id") REFERENCES "public"."users"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "page_information" DROP COLUMN "title";--> statement-breakpoint
ALTER TABLE "page_information" DROP COLUMN "notice_title";--> statement-breakpoint
ALTER TABLE "page_information" DROP COLUMN "notice_content";--> statement-breakpoint
ALTER TABLE "page_information" ADD CONSTRAINT "page_information_page_path_unique" UNIQUE("page_path");