summaryrefslogtreecommitdiff
path: root/db/migrations/0272_low_the_hood.sql
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrations/0272_low_the_hood.sql')
-rw-r--r--db/migrations/0272_low_the_hood.sql28
1 files changed, 28 insertions, 0 deletions
diff --git a/db/migrations/0272_low_the_hood.sql b/db/migrations/0272_low_the_hood.sql
new file mode 100644
index 00000000..35680454
--- /dev/null
+++ b/db/migrations/0272_low_the_hood.sql
@@ -0,0 +1,28 @@
+CREATE TABLE "pr_items_for_bidding" (
+ "id" serial PRIMARY KEY NOT NULL,
+ "bidding_id" integer NOT NULL,
+ "item_number" varchar(50),
+ "project_info" varchar(300),
+ "item_info" varchar(300),
+ "shi" varchar(100),
+ "requested_delivery_date" date,
+ "annual_unit_price" numeric(15, 2),
+ "currency" varchar(3) DEFAULT 'KRW',
+ "quantity" numeric(10, 2),
+ "quantity_unit" "quantity_unit",
+ "total_weight" numeric(10, 2),
+ "weight_unit" "weight_unit",
+ "material_description" text,
+ "pr_number" varchar(50),
+ "has_spec_document" boolean DEFAULT false,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "updated_at" timestamp DEFAULT now() NOT NULL
+);
+--> statement-breakpoint
+ALTER TABLE "bidding_documents" DROP CONSTRAINT "bidding_documents_pr_item_id_pr_items_id_fk";
+--> statement-breakpoint
+ALTER TABLE "company_pr_item_bids" DROP CONSTRAINT "company_pr_item_bids_pr_item_id_pr_items_id_fk";
+--> statement-breakpoint
+ALTER TABLE "pr_items_for_bidding" ADD CONSTRAINT "pr_items_for_bidding_bidding_id_biddings_id_fk" FOREIGN KEY ("bidding_id") REFERENCES "public"."biddings"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "bidding_documents" ADD CONSTRAINT "bidding_documents_pr_item_id_pr_items_for_bidding_id_fk" FOREIGN KEY ("pr_item_id") REFERENCES "public"."pr_items_for_bidding"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "company_pr_item_bids" ADD CONSTRAINT "company_pr_item_bids_pr_item_id_pr_items_for_bidding_id_fk" FOREIGN KEY ("pr_item_id") REFERENCES "public"."pr_items_for_bidding"("id") ON DELETE no action ON UPDATE no action; \ No newline at end of file