diff options
| author | joonhoekim <26rote@gmail.com> | 2025-03-25 15:55:45 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-03-25 15:55:45 +0900 |
| commit | 1a2241c40e10193c5ff7008a7b7b36cc1d855d96 (patch) | |
| tree | 8a5587f10ca55b162d7e3254cb088b323a34c41b /db/migrations/0006_tan_mongu.sql | |
initial commit
Diffstat (limited to 'db/migrations/0006_tan_mongu.sql')
| -rw-r--r-- | db/migrations/0006_tan_mongu.sql | 2 |
1 files changed, 2 insertions, 0 deletions
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 |
