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:
@ -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;
|
||||
--//
|
@ -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
|
||||
|
Reference in New Issue
Block a user