From e0dfb55c5457aec489fc084c4567e791b4c65eb1 Mon Sep 17 00:00:00 2001
From: dujinkim <dujin.kim@dtsolution.co.kr>
Date: Wed, 26 Mar 2025 00:37:41 +0000
Subject: 3/25 까지의 대표님 작업사항
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 db/migrations/0006_tan_mongu.sql | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 db/migrations/0006_tan_mongu.sql

(limited to 'db/migrations/0006_tan_mongu.sql')

diff --git a/db/migrations/0006_tan_mongu.sql b/db/migrations/0006_tan_mongu.sql
new file mode 100644
index 00000000..418429d5
--- /dev/null
+++ b/db/migrations/0006_tan_mongu.sql
@@ -0,0 +1,2 @@
+DROP VIEW "public"."role_view";--> statement-breakpoint
+CREATE VIEW "public"."role_view" AS (select "roles"."id" as "id", "roles"."name" as "name", "roles"."description" as "description", "roles"."domain" as "domain", "roles"."created_at" as "created_at", "companies"."id" as "company_id", "companies"."name" as "company_name", COUNT("users"."id") as "user_count" from "roles" left join "user_roles" on "user_roles"."role_id" = "roles"."id" left join "users" on "users"."id" = "user_roles"."user_id" left join "companies" on "roles"."company_id" = "companies"."id" group by "roles"."id", "companies"."id");
\ No newline at end of file
-- 
cgit v1.2.3

