diff options
Diffstat (limited to 'db/migrations_backup/0005_loud_whizzer.sql')
| -rw-r--r-- | db/migrations_backup/0005_loud_whizzer.sql | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/db/migrations_backup/0005_loud_whizzer.sql b/db/migrations_backup/0005_loud_whizzer.sql new file mode 100644 index 00000000..cfd7a735 --- /dev/null +++ b/db/migrations_backup/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 |
