summaryrefslogtreecommitdiff
path: root/db/migrations/0181_easy_blazing_skull.sql
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrations/0181_easy_blazing_skull.sql')
-rw-r--r--db/migrations/0181_easy_blazing_skull.sql19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrations/0181_easy_blazing_skull.sql b/db/migrations/0181_easy_blazing_skull.sql
new file mode 100644
index 00000000..9f5c0639
--- /dev/null
+++ b/db/migrations/0181_easy_blazing_skull.sql
@@ -0,0 +1,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"); \ No newline at end of file