From e9897d416b3e7327bbd4d4aef887eee37751ae82 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Fri, 27 Jun 2025 01:16:20 +0000
Subject: (대표님) 20250627 오전 10시 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 db/migrations/0166_supreme_amazoness.sql | 5 +++++
 1 file changed, 5 insertions(+)
 create mode 100644 db/migrations/0166_supreme_amazoness.sql

(limited to 'db/migrations/0166_supreme_amazoness.sql')

diff --git a/db/migrations/0166_supreme_amazoness.sql b/db/migrations/0166_supreme_amazoness.sql
new file mode 100644
index 00000000..ee372af9
--- /dev/null
+++ b/db/migrations/0166_supreme_amazoness.sql
@@ -0,0 +1,5 @@
+DROP VIEW "public"."user_view";--> statement-breakpoint
+ALTER TABLE "tech_sales_vendor_quotations" ALTER COLUMN "quotation_version" DROP DEFAULT;--> statement-breakpoint
+CREATE VIEW "public"."user_view" AS (select "users"."id" as "user_id", "users"."name" as "user_name", "users"."phone" as "user_phone", "users"."email" as "user_email", "users"."domain" as "user_domain", "users"."image_url" as "user_image", "vendors"."id" as "company_id", "vendors"."vendor_name" as "company_name", 
+      array_agg("roles"."name")
+     as "roles", "users"."created_at" as "created_at" from "users" left join "vendors" on "users"."company_id" = "vendors"."id" left join "user_roles" on "users"."id" = "user_roles"."user_id" left join "roles" on "user_roles"."role_id" = "roles"."id" group by "users"."id", "vendors"."id");
\ No newline at end of file
-- 
cgit v1.2.3

