From 5c9995030aec166571ad2cb199f869d2483665a8 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Jan 2026 06:39:45 +0000 Subject: [PATCH 1/4] Add table_template_module for unified table creation templates --- .../tables/table_template_module/table.sql | 43 +++++++++++++++++++ packages/metaschema-modules/pgpm.plan | 1 + .../tables/table_template_module/table.sql | 7 +++ .../tables/table_template_module/table.sql | 18 ++++++++ 4 files changed, 69 insertions(+) create mode 100644 packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/table_template_module/table.sql create mode 100644 packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/table_template_module/table.sql create mode 100644 packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/table_template_module/table.sql diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/table_template_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/table_template_module/table.sql new file mode 100644 index 00000000..06deb600 --- /dev/null +++ b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/table_template_module/table.sql @@ -0,0 +1,43 @@ +-- Deploy schemas/metaschema_modules_public/tables/table_template_module/table to pg + +-- requires: schemas/metaschema_modules_public/schema + +BEGIN; + +CREATE TABLE metaschema_modules_public.table_template_module ( + id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (), + database_id uuid NOT NULL, + + schema_id uuid NOT NULL DEFAULT uuid_nil(), + private_schema_id uuid NOT NULL DEFAULT uuid_nil(), + + table_id uuid NOT NULL DEFAULT uuid_nil(), + owner_table_id uuid NOT NULL DEFAULT uuid_nil(), + + table_name text NOT NULL, + + node_type text NOT NULL, + + data jsonb NOT NULL DEFAULT '{}', + + -- + CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE, + CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE, + CONSTRAINT owner_table_fkey FOREIGN KEY (owner_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE, + CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE, + CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE +); + +COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.table_template_module IS E'@omit manyToMany'; +COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.table_template_module IS E'@omit manyToMany'; +COMMENT ON CONSTRAINT table_fkey ON metaschema_modules_public.table_template_module IS E'@omit manyToMany'; +COMMENT ON CONSTRAINT owner_table_fkey ON metaschema_modules_public.table_template_module IS E'@omit manyToMany'; +COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.table_template_module IS E'@omit manyToMany'; +CREATE INDEX table_template_module_database_id_idx ON metaschema_modules_public.table_template_module ( database_id ); +CREATE INDEX table_template_module_schema_id_idx ON metaschema_modules_public.table_template_module ( schema_id ); +CREATE INDEX table_template_module_private_schema_id_idx ON metaschema_modules_public.table_template_module ( private_schema_id ); +CREATE INDEX table_template_module_table_id_idx ON metaschema_modules_public.table_template_module ( table_id ); +CREATE INDEX table_template_module_owner_table_id_idx ON metaschema_modules_public.table_template_module ( owner_table_id ); +CREATE INDEX table_template_module_node_type_idx ON metaschema_modules_public.table_template_module ( node_type ); + +COMMIT; diff --git a/packages/metaschema-modules/pgpm.plan b/packages/metaschema-modules/pgpm.plan index 1c43224e..473dfbcb 100644 --- a/packages/metaschema-modules/pgpm.plan +++ b/packages/metaschema-modules/pgpm.plan @@ -31,6 +31,7 @@ schemas/metaschema_modules_public/tables/users_module/table [schemas/metaschema_ schemas/metaschema_modules_public/tables/uuid_module/table [schemas/metaschema_modules_public/schema] 2017-08-11T08:11:51Z skitch # add schemas/metaschema_modules_public/tables/uuid_module/table schemas/metaschema_modules_public/tables/hierarchy_module/table [schemas/metaschema_modules_public/schema] 2024-12-28T00:00:00Z skitch # add schemas/metaschema_modules_public/tables/hierarchy_module/table schemas/metaschema_modules_public/tables/table_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin # add schemas/metaschema_modules_public/tables/table_module/table +schemas/metaschema_modules_public/tables/table_template_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin # add schemas/metaschema_modules_public/tables/table_template_module/table schemas/metaschema_modules_public/tables/user_profiles_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin # add schemas/metaschema_modules_public/tables/user_profiles_module/table schemas/metaschema_modules_public/tables/user_settings_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin # add schemas/metaschema_modules_public/tables/user_settings_module/table schemas/metaschema_modules_public/tables/organization_settings_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin # add schemas/metaschema_modules_public/tables/organization_settings_module/table diff --git a/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/table_template_module/table.sql b/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/table_template_module/table.sql new file mode 100644 index 00000000..65aebc56 --- /dev/null +++ b/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/table_template_module/table.sql @@ -0,0 +1,7 @@ +-- Revert schemas/metaschema_modules_public/tables/table_template_module/table from pg + +BEGIN; + +DROP TABLE IF EXISTS metaschema_modules_public.table_template_module; + +COMMIT; diff --git a/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/table_template_module/table.sql b/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/table_template_module/table.sql new file mode 100644 index 00000000..c1d7dd59 --- /dev/null +++ b/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/table_template_module/table.sql @@ -0,0 +1,18 @@ +-- Verify schemas/metaschema_modules_public/tables/table_template_module/table on pg + +BEGIN; + +SELECT + id, + database_id, + schema_id, + private_schema_id, + table_id, + owner_table_id, + table_name, + node_type, + data +FROM metaschema_modules_public.table_template_module +WHERE FALSE; + +ROLLBACK; From f96775ae6abfe48febb659d43ba315df58a1510e Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Jan 2026 06:51:45 +0000 Subject: [PATCH 2/4] Update snapshots for table_template_module --- .../__tests__/__snapshots__/modules.test.ts.snap | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap b/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap index 4220a140..c863f194 100644 --- a/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap +++ b/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap @@ -23,6 +23,7 @@ exports[`db_meta_modules should have all expected module tables 1`] = ` "rls_module", "secrets_module", "table_module", + "table_template_module", "tokens_module", "user_auth_module", "user_profiles_module", @@ -35,8 +36,8 @@ exports[`db_meta_modules should have all expected module tables 1`] = ` exports[`db_meta_modules should verify all module tables exist in metaschema_modules_public schema 1`] = ` { - "moduleTablesCount": 26, - "totalTables": 27, + "moduleTablesCount": 27, + "totalTables": 28, } `; @@ -91,13 +92,13 @@ exports[`db_meta_modules should verify emails_module table structure 1`] = ` exports[`db_meta_modules should verify module table structures have database_id foreign keys 1`] = ` { - "constraintCount": 78650, + "constraintCount": 84672, } `; exports[`db_meta_modules should verify module tables have proper foreign key relationships 1`] = ` { - "constraintCount": 113921, + "constraintCount": 124779, "foreignTables": [ "apis", "database", From b67ae084c59e5bbce25c381e3cda2bc754a4afff Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Jan 2026 07:01:55 +0000 Subject: [PATCH 3/4] Remove old module tables (user_profiles_module, user_settings_module, organization_settings_module) --- .../__snapshots__/modules.test.ts.snap | 7 ++-- .../organization_settings_module/table.sql | 34 ------------------- .../tables/user_profiles_module/table.sql | 34 ------------------- .../tables/user_settings_module/table.sql | 34 ------------------- packages/metaschema-modules/pgpm.plan | 3 -- .../organization_settings_module/table.sql | 7 ---- .../tables/user_profiles_module/table.sql | 7 ---- .../tables/user_settings_module/table.sql | 7 ---- .../organization_settings_module/table.sql | 16 --------- .../tables/user_profiles_module/table.sql | 16 --------- .../tables/user_settings_module/table.sql | 16 --------- 11 files changed, 2 insertions(+), 179 deletions(-) delete mode 100644 packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql delete mode 100644 packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql delete mode 100644 packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_settings_module/table.sql delete mode 100644 packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql delete mode 100644 packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql delete mode 100644 packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/user_settings_module/table.sql delete mode 100644 packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql delete mode 100644 packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql delete mode 100644 packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/user_settings_module/table.sql diff --git a/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap b/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap index c863f194..6b53ef26 100644 --- a/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap +++ b/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap @@ -16,7 +16,6 @@ exports[`db_meta_modules should have all expected module tables 1`] = ` "limits_module", "membership_types_module", "memberships_module", - "organization_settings_module", "permissions_module", "phone_numbers_module", "profiles_module", @@ -26,8 +25,6 @@ exports[`db_meta_modules should have all expected module tables 1`] = ` "table_template_module", "tokens_module", "user_auth_module", - "user_profiles_module", - "user_settings_module", "users_module", "uuid_module", ], @@ -36,8 +33,8 @@ exports[`db_meta_modules should have all expected module tables 1`] = ` exports[`db_meta_modules should verify all module tables exist in metaschema_modules_public schema 1`] = ` { - "moduleTablesCount": 27, - "totalTables": 28, + "moduleTablesCount": 24, + "totalTables": 25, } `; diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql deleted file mode 100644 index b93b66ef..00000000 --- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql +++ /dev/null @@ -1,34 +0,0 @@ --- Deploy schemas/metaschema_modules_public/tables/organization_settings_module/table to pg - --- requires: schemas/metaschema_modules_public/schema - -BEGIN; - -CREATE TABLE metaschema_modules_public.organization_settings_module ( - id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (), - database_id uuid NOT NULL, - - schema_id uuid NOT NULL DEFAULT uuid_nil(), - private_schema_id uuid NOT NULL DEFAULT uuid_nil(), - - table_id uuid NOT NULL DEFAULT uuid_nil(), - owner_table_id uuid NOT NULL DEFAULT uuid_nil(), - - table_name text NOT NULL, - - -- - CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE, - CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE, - CONSTRAINT owner_table_fkey FOREIGN KEY (owner_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE, - CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE, - CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE -); - -COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.organization_settings_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.organization_settings_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT table_fkey ON metaschema_modules_public.organization_settings_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT owner_table_fkey ON metaschema_modules_public.organization_settings_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.organization_settings_module IS E'@omit manyToMany'; -CREATE INDEX organization_settings_module_database_id_idx ON metaschema_modules_public.organization_settings_module ( database_id ); - -COMMIT; diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql deleted file mode 100644 index 285f483e..00000000 --- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql +++ /dev/null @@ -1,34 +0,0 @@ --- Deploy schemas/metaschema_modules_public/tables/user_profiles_module/table to pg - --- requires: schemas/metaschema_modules_public/schema - -BEGIN; - -CREATE TABLE metaschema_modules_public.user_profiles_module ( - id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (), - database_id uuid NOT NULL, - - schema_id uuid NOT NULL DEFAULT uuid_nil(), - private_schema_id uuid NOT NULL DEFAULT uuid_nil(), - - table_id uuid NOT NULL DEFAULT uuid_nil(), - owner_table_id uuid NOT NULL DEFAULT uuid_nil(), - - table_name text NOT NULL, - - -- - CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE, - CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE, - CONSTRAINT owner_table_fkey FOREIGN KEY (owner_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE, - CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE, - CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE -); - -COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.user_profiles_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.user_profiles_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT table_fkey ON metaschema_modules_public.user_profiles_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT owner_table_fkey ON metaschema_modules_public.user_profiles_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.user_profiles_module IS E'@omit manyToMany'; -CREATE INDEX user_profiles_module_database_id_idx ON metaschema_modules_public.user_profiles_module ( database_id ); - -COMMIT; diff --git a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_settings_module/table.sql b/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_settings_module/table.sql deleted file mode 100644 index ed38c80a..00000000 --- a/packages/metaschema-modules/deploy/schemas/metaschema_modules_public/tables/user_settings_module/table.sql +++ /dev/null @@ -1,34 +0,0 @@ --- Deploy schemas/metaschema_modules_public/tables/user_settings_module/table to pg - --- requires: schemas/metaschema_modules_public/schema - -BEGIN; - -CREATE TABLE metaschema_modules_public.user_settings_module ( - id uuid PRIMARY KEY DEFAULT uuid_generate_v4 (), - database_id uuid NOT NULL, - - schema_id uuid NOT NULL DEFAULT uuid_nil(), - private_schema_id uuid NOT NULL DEFAULT uuid_nil(), - - table_id uuid NOT NULL DEFAULT uuid_nil(), - owner_table_id uuid NOT NULL DEFAULT uuid_nil(), - - table_name text NOT NULL, - - -- - CONSTRAINT db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE, - CONSTRAINT table_fkey FOREIGN KEY (table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE, - CONSTRAINT owner_table_fkey FOREIGN KEY (owner_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE, - CONSTRAINT schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE, - CONSTRAINT private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE -); - -COMMENT ON CONSTRAINT schema_fkey ON metaschema_modules_public.user_settings_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT private_schema_fkey ON metaschema_modules_public.user_settings_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT table_fkey ON metaschema_modules_public.user_settings_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT owner_table_fkey ON metaschema_modules_public.user_settings_module IS E'@omit manyToMany'; -COMMENT ON CONSTRAINT db_fkey ON metaschema_modules_public.user_settings_module IS E'@omit manyToMany'; -CREATE INDEX user_settings_module_database_id_idx ON metaschema_modules_public.user_settings_module ( database_id ); - -COMMIT; diff --git a/packages/metaschema-modules/pgpm.plan b/packages/metaschema-modules/pgpm.plan index 473dfbcb..f26dc7f1 100644 --- a/packages/metaschema-modules/pgpm.plan +++ b/packages/metaschema-modules/pgpm.plan @@ -32,6 +32,3 @@ schemas/metaschema_modules_public/tables/uuid_module/table [schemas/metaschema_m schemas/metaschema_modules_public/tables/hierarchy_module/table [schemas/metaschema_modules_public/schema] 2024-12-28T00:00:00Z skitch # add schemas/metaschema_modules_public/tables/hierarchy_module/table schemas/metaschema_modules_public/tables/table_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin # add schemas/metaschema_modules_public/tables/table_module/table schemas/metaschema_modules_public/tables/table_template_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin # add schemas/metaschema_modules_public/tables/table_template_module/table -schemas/metaschema_modules_public/tables/user_profiles_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin # add schemas/metaschema_modules_public/tables/user_profiles_module/table -schemas/metaschema_modules_public/tables/user_settings_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin # add schemas/metaschema_modules_public/tables/user_settings_module/table -schemas/metaschema_modules_public/tables/organization_settings_module/table [schemas/metaschema_modules_public/schema] 2026-01-14T00:00:00Z devin # add schemas/metaschema_modules_public/tables/organization_settings_module/table diff --git a/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql b/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql deleted file mode 100644 index 8b045968..00000000 --- a/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql +++ /dev/null @@ -1,7 +0,0 @@ --- Revert schemas/metaschema_modules_public/tables/organization_settings_module/table from pg - -BEGIN; - -DROP TABLE IF EXISTS metaschema_modules_public.organization_settings_module; - -COMMIT; diff --git a/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql b/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql deleted file mode 100644 index 521fdee0..00000000 --- a/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql +++ /dev/null @@ -1,7 +0,0 @@ --- Revert schemas/metaschema_modules_public/tables/user_profiles_module/table from pg - -BEGIN; - -DROP TABLE IF EXISTS metaschema_modules_public.user_profiles_module; - -COMMIT; diff --git a/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/user_settings_module/table.sql b/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/user_settings_module/table.sql deleted file mode 100644 index 95138ae6..00000000 --- a/packages/metaschema-modules/revert/schemas/metaschema_modules_public/tables/user_settings_module/table.sql +++ /dev/null @@ -1,7 +0,0 @@ --- Revert schemas/metaschema_modules_public/tables/user_settings_module/table from pg - -BEGIN; - -DROP TABLE IF EXISTS metaschema_modules_public.user_settings_module; - -COMMIT; diff --git a/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql b/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql deleted file mode 100644 index ef5ee55d..00000000 --- a/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/organization_settings_module/table.sql +++ /dev/null @@ -1,16 +0,0 @@ --- Verify schemas/metaschema_modules_public/tables/organization_settings_module/table on pg - -BEGIN; - -SELECT - id, - database_id, - schema_id, - private_schema_id, - table_id, - owner_table_id, - table_name -FROM metaschema_modules_public.organization_settings_module -WHERE FALSE; - -ROLLBACK; diff --git a/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql b/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql deleted file mode 100644 index cf61cae2..00000000 --- a/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/user_profiles_module/table.sql +++ /dev/null @@ -1,16 +0,0 @@ --- Verify schemas/metaschema_modules_public/tables/user_profiles_module/table on pg - -BEGIN; - -SELECT - id, - database_id, - schema_id, - private_schema_id, - table_id, - owner_table_id, - table_name -FROM metaschema_modules_public.user_profiles_module -WHERE FALSE; - -ROLLBACK; diff --git a/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/user_settings_module/table.sql b/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/user_settings_module/table.sql deleted file mode 100644 index d6ece694..00000000 --- a/packages/metaschema-modules/verify/schemas/metaschema_modules_public/tables/user_settings_module/table.sql +++ /dev/null @@ -1,16 +0,0 @@ --- Verify schemas/metaschema_modules_public/tables/user_settings_module/table on pg - -BEGIN; - -SELECT - id, - database_id, - schema_id, - private_schema_id, - table_id, - owner_table_id, - table_name -FROM metaschema_modules_public.user_settings_module -WHERE FALSE; - -ROLLBACK; From 248b9f8f3f81ad9327c29e781acf74f878dee456 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Jan 2026 07:17:05 +0000 Subject: [PATCH 4/4] Fix snapshot constraint counts after removing old modules --- .../__tests__/__snapshots__/modules.test.ts.snap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap b/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap index 6b53ef26..4c485783 100644 --- a/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap +++ b/packages/metaschema-modules/__tests__/__snapshots__/modules.test.ts.snap @@ -89,13 +89,13 @@ exports[`db_meta_modules should verify emails_module table structure 1`] = ` exports[`db_meta_modules should verify module table structures have database_id foreign keys 1`] = ` { - "constraintCount": 84672, + "constraintCount": 67416, } `; exports[`db_meta_modules should verify module tables have proper foreign key relationships 1`] = ` { - "constraintCount": 124779, + "constraintCount": 94299, "foreignTables": [ "apis", "database",