From b7f5af1f4b6691052bb3e77968a478ff27696095 Mon Sep 17 00:00:00 2001 From: dujinkim Date: Wed, 28 May 2025 00:33:50 +0000 Subject: (대표님 / 최겸) 스키마 변경사항 및 마이그레이션 커밋 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrations/0091_tricky_risque.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 db/migrations/0091_tricky_risque.sql (limited to 'db/migrations/0091_tricky_risque.sql') diff --git a/db/migrations/0091_tricky_risque.sql b/db/migrations/0091_tricky_risque.sql new file mode 100644 index 00000000..26dd6b54 --- /dev/null +++ b/db/migrations/0091_tricky_risque.sql @@ -0,0 +1,8 @@ +DROP VIEW "public"."vendors_with_types";--> statement-breakpoint +CREATE VIEW "public"."vendors_with_types" AS (select "vendors"."id" as "id", "vendors"."vendor_name" as "vendor_name", "vendors"."vendor_code" as "vendor_code", "vendors"."tax_id" as "tax_id", "vendors"."address" as "address", "vendors"."country" as "country", "vendors"."phone" as "phone", "vendors"."email" as "email", "vendors"."business_size" as "business_size", "vendors"."website" as "website", "vendors"."status" as "status", "vendors"."vendor_type_id" as "vendor_type_id", "vendors"."representative_name" as "representative_name", "vendors"."representative_birth" as "representative_birth", "vendors"."representative_email" as "representative_email", "vendors"."representative_phone" as "representative_phone", "vendors"."corporate_registration_number" as "corporate_registration_number", "vendors"."items" as "items", "vendors"."credit_agency" as "credit_agency", "vendors"."credit_rating" as "credit_rating", "vendors"."cash_flow_rating" as "cash_flow_rating", "vendors"."created_at" as "created_at", "vendors"."updated_at" as "updated_at", "vendor_types"."name_ko" as "vendor_type_name", "vendor_types"."name_en" as "vendor_type_name_en", "vendor_types"."code" as "vendor_type_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 -- cgit v1.2.3