From 1a2241c40e10193c5ff7008a7b7b36cc1d855d96 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Tue, 25 Mar 2025 15:55:45 +0900 Subject: initial commit --- db/migrations/0005_loud_whizzer.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 db/migrations/0005_loud_whizzer.sql (limited to 'db/migrations/0005_loud_whizzer.sql') diff --git a/db/migrations/0005_loud_whizzer.sql b/db/migrations/0005_loud_whizzer.sql new file mode 100644 index 00000000..cfd7a735 --- /dev/null +++ b/db/migrations/0005_loud_whizzer.sql @@ -0,0 +1 @@ +CREATE VIEW "public"."role_view" AS (select "roles"."id", "roles"."name", "roles"."description", "roles"."domain", "roles"."created_at", "roles"."company_id", "companies"."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