From 1de4ae52429391ac120d326d850cb273ee02fd55 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Jan 2026 00:45:54 +0000 Subject: [PATCH 1/2] feat: update export flow for new metaschema tables and columns - Add table_module, user_profiles_module, user_settings_module, organization_settings_module configs to export-meta.ts - Add node_type field to field_module config - Add default_is_approved and default_is_verified fields to memberships_module config - Add new module tables to tableOrder in export-migrations.ts This aligns with the upstream changes to constructive-io/pgpm-modules. --- pgpm/core/src/export/export-meta.ts | 58 ++++++++++++++++++++++- pgpm/core/src/export/export-migrations.ts | 4 ++ 2 files changed, 61 insertions(+), 1 deletion(-) diff --git a/pgpm/core/src/export/export-meta.ts b/pgpm/core/src/export/export-meta.ts index 26b46bac5..8ea43a485 100644 --- a/pgpm/core/src/export/export-meta.ts +++ b/pgpm/core/src/export/export-meta.ts @@ -553,7 +553,9 @@ const config: Record = { actor_perm_check: 'text', entity_ids_by_mask: 'text', entity_ids_by_perm: 'text', - entity_ids_function: 'text' + entity_ids_function: 'text', + default_is_approved: 'boolean', + default_is_verified: 'boolean' } }, permissions_module: { @@ -846,11 +848,65 @@ const config: Record = { private_schema_id: 'uuid', table_id: 'uuid', field_id: 'uuid', + node_type: 'text', data: 'jsonb', triggers: 'text[]', functions: 'text[]' } }, + table_module: { + schema: 'metaschema_modules_public', + table: 'table_module', + fields: { + id: 'uuid', + database_id: 'uuid', + private_schema_id: 'uuid', + table_id: 'uuid', + node_type: 'text', + data: 'jsonb', + fields: 'uuid[]' + } + }, + user_profiles_module: { + schema: 'metaschema_modules_public', + table: 'user_profiles_module', + fields: { + id: 'uuid', + database_id: 'uuid', + schema_id: 'uuid', + private_schema_id: 'uuid', + table_id: 'uuid', + table_name: 'text', + users_table_id: 'uuid' + } + }, + user_settings_module: { + schema: 'metaschema_modules_public', + table: 'user_settings_module', + fields: { + id: 'uuid', + database_id: 'uuid', + schema_id: 'uuid', + private_schema_id: 'uuid', + table_id: 'uuid', + table_name: 'text', + users_table_id: 'uuid' + } + }, + organization_settings_module: { + schema: 'metaschema_modules_public', + table: 'organization_settings_module', + fields: { + id: 'uuid', + database_id: 'uuid', + schema_id: 'uuid', + private_schema_id: 'uuid', + table_id: 'uuid', + table_name: 'text', + entity_table_id: 'uuid', + membership_type: 'int' + } + }, uuid_module: { schema: 'metaschema_modules_public', table: 'uuid_module', diff --git a/pgpm/core/src/export/export-migrations.ts b/pgpm/core/src/export/export-migrations.ts index 3e188d44c..c6b2de159 100644 --- a/pgpm/core/src/export/export-migrations.ts +++ b/pgpm/core/src/export/export-migrations.ts @@ -409,6 +409,10 @@ SET session_replication_role TO DEFAULT;`; 'crypto_addresses_module', 'crypto_auth_module', 'field_module', + 'table_module', + 'user_profiles_module', + 'user_settings_module', + 'organization_settings_module', 'uuid_module', 'default_ids_module', 'denormalized_table_field' From 7e5387a1b270751e59aaaad7699a3ccaeac5cde3 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Wed, 14 Jan 2026 01:13:31 +0000 Subject: [PATCH 2/2] refactor: remove default_is_approved/default_is_verified from memberships_module config These columns are being removed in favor of a secure-by-default approach. --- pgpm/core/src/export/export-meta.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pgpm/core/src/export/export-meta.ts b/pgpm/core/src/export/export-meta.ts index 8ea43a485..944e7bcd2 100644 --- a/pgpm/core/src/export/export-meta.ts +++ b/pgpm/core/src/export/export-meta.ts @@ -553,12 +553,10 @@ const config: Record = { actor_perm_check: 'text', entity_ids_by_mask: 'text', entity_ids_by_perm: 'text', - entity_ids_function: 'text', - default_is_approved: 'boolean', - default_is_verified: 'boolean' + entity_ids_function: 'text' } }, - permissions_module: { + permissions_module:{ schema: 'metaschema_modules_public', table: 'permissions_module', fields: {