KB-8E24 rev 3

HC-REG unregistered tables query

1 min read Revision 3
health-checksqllaw-36fix25

-- HC-REG: Count of public BASE TABLEs not in collection_registry (excludes directus_/pg_/temp_) -- DB: directus | Schema: public | Read-only | Returns single-row count for dispatch_sql SELECT count()::int AS unregistered_count FROM ( SELECT t.table_name FROM information_schema.tables t WHERE t.table_schema = 'public' AND t.table_type = 'BASE TABLE' AND t.table_name NOT IN (SELECT collection_name FROM collection_registry) AND t.table_name NOT LIKE 'directus_%' AND t.table_name NOT LIKE 'pg_%' AND t.table_name NOT LIKE 'temp_%' ) t