1
0

import-database-users-and-databases (#82)

Co-authored-by: Michael Hoennig <michael@hoennig.de>
Reviewed-on: https://dev.hostsharing.net/hostsharing/hs.hsadmin.ng/pulls/82
Reviewed-by: Marc Sandlus <marc.sandlus@hostsharing.net>
This commit is contained in:
Michael Hoennig
2024-08-02 10:40:15 +02:00
parent d6a0511d98
commit e4e1216a85
19 changed files with 388 additions and 41 deletions

View File

@ -0,0 +1,23 @@
--liquibase formatted sql
-- ============================================================================
--changeset hs-global-object-statistics:1 endDelimiter:--//
-- ----------------------------------------------------------------------------
CREATE VIEW hs_statistics_view AS
select *
from (select count, "table" as "rbac-table", '' as "hs-table", '' as "type"
from rbacstatisticsview
union all
select to_char(count(*)::int, '9 999 999 999') as "count", 'objects' as "rbac-table", objecttable as "hs-table", '' as "type"
from rbacobject
group by objecttable
union all
select to_char(count(*)::int, '9 999 999 999'), 'objects', 'hs_hosting_asset', type::text
from hs_hosting_asset
group by type
union all
select to_char(count(*)::int, '9 999 999 999'), 'objects', 'hs_booking_item', type::text
from hs_booking_item
group by type
) as totals order by replace(count, ' ', '')::int desc;
--//

View File

@ -151,3 +151,5 @@ databaseChangeLog:
file: db/changelog/7-hs-hosting/701-hosting-asset/7013-hs-hosting-asset-rbac.sql
- include:
file: db/changelog/7-hs-hosting/701-hosting-asset/7018-hs-hosting-asset-test-data.sql
- include:
file: db/changelog/9-hs-global/9000-statistics.sql