summaryrefslogtreecommitdiff
path: root/db/migrations/0014_clammy_power_man.sql
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-03-25 15:55:45 +0900
committerjoonhoekim <26rote@gmail.com>2025-03-25 15:55:45 +0900
commit1a2241c40e10193c5ff7008a7b7b36cc1d855d96 (patch)
tree8a5587f10ca55b162d7e3254cb088b323a34c41b /db/migrations/0014_clammy_power_man.sql
initial commit
Diffstat (limited to 'db/migrations/0014_clammy_power_man.sql')
-rw-r--r--db/migrations/0014_clammy_power_man.sql14
1 files changed, 14 insertions, 0 deletions
diff --git a/db/migrations/0014_clammy_power_man.sql b/db/migrations/0014_clammy_power_man.sql
new file mode 100644
index 00000000..3fd6a1e3
--- /dev/null
+++ b/db/migrations/0014_clammy_power_man.sql
@@ -0,0 +1,14 @@
+CREATE TABLE "items" (
+ "id" serial PRIMARY KEY NOT NULL,
+ "item_code" varchar(100) PRIMARY KEY NOT NULL,
+ "item_name" varchar(255) NOT NULL,
+ "description" text,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "updated_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "vendor_possible_items" ALTER COLUMN "item_code" SET NOT NULL;--> statement-breakpoint
+ALTER TABLE "rfq_items" ADD CONSTRAINT "rfq_items_item_code_items_item_code_fk" FOREIGN KEY ("item_code") REFERENCES "public"."items"("item_code") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "vendor_possible_items" ADD CONSTRAINT "vendor_possible_items_item_code_items_item_code_fk" FOREIGN KEY ("item_code") REFERENCES "public"."items"("item_code") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "rfq_items" DROP COLUMN "item_name";--> statement-breakpoint
+ALTER TABLE "vendor_possible_items" DROP COLUMN "item_name"; \ No newline at end of file