From 9ceed79cf32c896f8a998399bf1b296506b2cd4a Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Tue, 8 Apr 2025 03:08:19 +0000
Subject: 로그인 및 미들웨어 처리. 구조 변경
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 db/migrations_backup/0073_damp_reaper.sql | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 db/migrations_backup/0073_damp_reaper.sql

(limited to 'db/migrations_backup/0073_damp_reaper.sql')

diff --git a/db/migrations_backup/0073_damp_reaper.sql b/db/migrations_backup/0073_damp_reaper.sql
new file mode 100644
index 00000000..437a2d04
--- /dev/null
+++ b/db/migrations_backup/0073_damp_reaper.sql
@@ -0,0 +1,13 @@
+DROP VIEW "public"."vendor_rfq_view";--> statement-breakpoint
+DROP VIEW "public"."vendor_rfqs_view";--> statement-breakpoint
+DROP VIEW "public"."vendor_tbe_view";--> statement-breakpoint
+ALTER TABLE "rfqs" ADD COLUMN "project_id" integer;--> statement-breakpoint
+ALTER TABLE "rfqs" ADD COLUMN "rfq_type" varchar(30) DEFAULT 'PURCHASE';--> statement-breakpoint
+ALTER TABLE "rfqs" ADD COLUMN "parent_rfq_id" integer;--> statement-breakpoint
+ALTER TABLE "rfqs" ADD CONSTRAINT "rfqs_project_id_projects_id_fk" FOREIGN KEY ("project_id") REFERENCES "public"."projects"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "rfqs" ADD CONSTRAINT "rfqs_parent_rfq_id_rfqs_id_fk" FOREIGN KEY ("parent_rfq_id") REFERENCES "public"."rfqs"("id") ON DELETE set null ON UPDATE no action;--> statement-breakpoint
+ALTER TABLE "rfqs" DROP COLUMN "project_code";--> statement-breakpoint
+ALTER TABLE "rfqs" DROP COLUMN "project_name";--> statement-breakpoint
+CREATE VIEW "public"."vendor_rfq_view" AS (select "vendors"."id" as "vendor_id", "vendors"."vendor_name" as "vendor_name", "vendors"."vendor_code" as "vendor_code", "vendors"."address" as "address", "vendors"."country" as "country", "vendors"."email" as "email", "vendors"."website" as "website", "vendors"."status" as "vendor_status", "rfq_vendors"."rfq_id" as "rfq_id", "rfq_vendors"."status" as "rfq_vendor_status", "rfq_vendors"."updated_at" as "rfq_vendor_updated", "rfqs"."rfq_code" as "rfq_code", "rfqs"."description" as "description", "rfqs"."due_date" as "due_date", "projects"."id" as "project_id", "projects"."code" as "project_code", "projects"."name" as "project_name" from "vendors" left join "rfq_vendors" on "rfq_vendors"."vendor_id" = "vendors"."id" left join "rfqs" on "rfq_vendors"."rfq_id" = "rfqs"."id" left join "projects" on "rfqs"."project_id" = "projects"."id");--> statement-breakpoint
+CREATE VIEW "public"."vendor_rfqs_view" AS (select "rfqs"."id" as "id", "rfqs"."status" as "status", "rfqs"."created_at" as "created_at", "rfqs"."updated_at" as "updated_at", "rfqs"."created_by" as "created_by", "rfq_vendors"."id" as "rfq_vendor_id", "rfq_vendors"."vendor_id" as "vendor_id", "rfq_vendors"."status" as "rfq_vendor_status", "rfq_vendors"."updated_at" as "rfq_vendor_updated", "rfqs"."rfq_code" as "rfq_code", "rfqs"."description" as "description", "rfqs"."due_date" as "due_date", "projects"."id" as "project_id", "projects"."code" as "project_code", "projects"."name" as "project_name" from "rfq_vendors" inner join "rfqs" on "rfq_vendors"."rfq_id" = "rfqs"."id" left join "projects" on "rfqs"."project_id" = "projects"."id");--> statement-breakpoint
+CREATE VIEW "public"."vendor_tbe_view" AS (select "vendors"."id" as "vendor_id", "vendors"."vendor_name" as "vendor_name", "vendors"."vendor_code" as "vendor_code", "vendors"."address" as "address", "vendors"."country" as "country", "vendors"."email" as "email", "vendors"."website" as "website", "vendors"."status" as "vendor_status", "rfq_vendors"."rfq_id" as "rfq_id", "rfq_vendors"."status" as "rfq_vendor_status", "rfq_vendors"."updated_at" as "rfq_vendor_updated", "rfqs"."rfq_code" as "rfq_code", "rfqs"."description" as "description", "rfqs"."due_date" as "due_date", "projects"."id" as "project_id", "projects"."code" as "project_code", "projects"."name" as "project_name", "rfq_evaluations"."id" as "tbe_id", "rfq_evaluations"."result" as "tbe_result", "rfq_evaluations"."notes" as "tbe_note", "rfq_evaluations"."updated_at" as "tbe_updated" from "vendors" left join "rfq_vendors" on "rfq_vendors"."vendor_id" = "vendors"."id" left join "rfqs" on "rfq_vendors"."rfq_id" = "rfqs"."id" left join "projects" on "rfqs"."project_id" = "projects"."id" left join "rfq_evaluations" on ("rfq_evaluations"."vendor_id" = "vendors"."id" and "rfq_evaluations"."eval_type" = 'TBE' and "rfq_evaluations"."rfq_id" = "rfq_vendors"."rfq_id"));
\ No newline at end of file
-- 
cgit v1.2.3

