summaryrefslogtreecommitdiff
path: root/db/migrations/0026_slimy_maddog.sql
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-04-28 02:13:30 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-04-28 02:13:30 +0000
commitef4c533ebacc2cdc97e518f30e9a9350004fcdfb (patch)
tree345251a3ed0f4429716fa5edaa31024d8f4cb560 /db/migrations/0026_slimy_maddog.sql
parent9ceed79cf32c896f8a998399bf1b296506b2cd4a (diff)
~20250428 작업사항
Diffstat (limited to 'db/migrations/0026_slimy_maddog.sql')
-rw-r--r--db/migrations/0026_slimy_maddog.sql7
1 files changed, 7 insertions, 0 deletions
diff --git a/db/migrations/0026_slimy_maddog.sql b/db/migrations/0026_slimy_maddog.sql
new file mode 100644
index 00000000..96b50a41
--- /dev/null
+++ b/db/migrations/0026_slimy_maddog.sql
@@ -0,0 +1,7 @@
+CREATE VIEW "public"."vendors_with_types" AS (select "vendors"."id", "vendors"."vendor_name", "vendors"."vendor_code", "vendors"."tax_id", "vendors"."address", "vendors"."country", "vendors"."phone", "vendors"."email", "vendors"."website", "vendors"."status", "vendors"."vendor_type_id", "vendors"."representative_name", "vendors"."representative_birth", "vendors"."representative_email", "vendors"."representative_phone", "vendors"."corporate_registration_number", "vendors"."items", "vendors"."credit_agency", "vendors"."credit_rating", "vendors"."cash_flow_rating", "vendors"."created_at", "vendors"."updated_at", "vendor_types"."name_ko", "vendor_types"."name_en", "vendor_types"."code",
+ CASE
+ WHEN "vendors"."status" = 'ACTIVE' THEN '정규업체'
+ WHEN "vendors"."status" IN ('INACTIVE', 'BLACKLISTED', 'REJECTED') THEN ''
+ ELSE '잠재업체'
+ END
+ as "vendor_category" from "vendors" left join "vendor_types" on "vendors"."vendor_type_id" = "vendor_types"."id"); \ No newline at end of file