From 7a1524ba54f43d0f2a19e4bca2c6a2e0b01c5ef1 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Tue, 17 Jun 2025 09:02:32 +0000
Subject: (대표님) 20250617 18시 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 db/migrations/0137_cool_wrecking_crew.sql | 35 +++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 db/migrations/0137_cool_wrecking_crew.sql

(limited to 'db/migrations/0137_cool_wrecking_crew.sql')

diff --git a/db/migrations/0137_cool_wrecking_crew.sql b/db/migrations/0137_cool_wrecking_crew.sql
new file mode 100644
index 00000000..ffc79d03
--- /dev/null
+++ b/db/migrations/0137_cool_wrecking_crew.sql
@@ -0,0 +1,35 @@
+DROP VIEW "public"."initial_rfq_detail";--> statement-breakpoint
+CREATE VIEW "public"."initial_rfq_detail" AS (
+    SELECT 
+        br.id as rfq_id,
+        br.rfq_code,
+        br.status as rfq_status,
+        ir.id as initial_rfq_id,
+        ir.initial_rfq_status,
+        ir.vendor_id,
+        v.vendor_code,
+        v.vendor_name,
+        v.country as vendor_country,
+        v.business_size as vendor_business_size,
+        v.vendorCategory as vendor_category,
+        ir.due_date,
+        ir.valid_date,
+        ir.incoterms_code,
+        inc.description as incoterms_description,
+        ir.short_list,
+        ir.return_yn,
+        ir.cp_request_yn,
+        ir.prject_gtc_yn,
+        ir.return_revision,
+        ir.rfq_revision,
+        ir.gtc,
+        ir.gtc_valid_date,
+        ir.classification,
+        ir.sparepart,
+        ir.created_at,
+        ir.updated_at
+    FROM b_rfqs br
+    JOIN initial_rfq ir ON br.id = ir.rfq_id
+    LEFT JOIN vendors_with_types v ON ir.vendor_id = v.id
+    LEFT JOIN incoterms inc ON ir.incoterms_code = inc.code
+);
\ No newline at end of file
-- 
cgit v1.2.3

