diff --git a/sql/modules/test/Payment.sql b/sql/modules/test/Payment.sql index 8647402315..bdba1ca9e8 100644 --- a/sql/modules/test/Payment.sql +++ b/sql/modules/test/Payment.sql @@ -21,9 +21,6 @@ values (currval('users_id_seq'), now(), md5('test2'), 2); INSERT INTO test_result(test_name, success) SELECT 'AP Batch created', (SELECT batch_create('test', 'test', 'ap', now()::date)) IS NOT NULL; -INSERT INTO entity (id, entity_class, name, control_code, country_id) -VALUES (-101, 1, 'TEST VENDOR', 'TEST 2', 242); - INSERT INTO company (id, legal_name, entity_id) VALUES (-101, 'TEST', -101); diff --git a/sql/modules/test/System.sql b/sql/modules/test/System.sql index 2c9876ea05..5c99d8994b 100644 --- a/sql/modules/test/System.sql +++ b/sql/modules/test/System.sql @@ -63,22 +63,11 @@ group by proname having count(*) > 1; CREATE TEMPORARY table permissionless_tables AS -select t.table_catalog, t.table_schema, t.table_type, t.table_name -from information_schema.tables t -where t.table_catalog = current_database() - and t.table_schema = 'public' - and not exists ( - select * - from information_schema.role_table_grants r - where r.table_catalog = t.table_catalog - and r.table_schema = t.table_schema - and r.table_name = t.table_name - ) - and not exists ( - select * - from test_exempt_tables x - where x.tablename = t.table_name) -order by t.table_catalog, t.table_schema, t.table_type, t.table_name; +SELECT nspname, relname + FROM pg_namespace nsp + JOIN pg_class rel ON (relkind = 'r' and nsp.oid = rel.relnamespace) + WHERE nspname = 'public' AND relacl IS NULL and relname NOT IN + (select tablename from test_exempt_tables); select * from permissionless_tables;