feat(pgpm/export): add missing module tables + spatial_relation to export config#1133
Merged
Merged
Conversation
Add all missing metaschema_modules_public tables: - billing_module, billing_provider_module, devices_module - entity_type_provision, identity_providers_module - notifications_module, plans_module, realtime_module - session_secrets_module, webauthn_auth_module, webauthn_credentials_module - blueprint, blueprint_construction, blueprint_template - rate_limits_module, relation_provision, storage_module Add missing metaschema_public tables: - node_type_registry, spatial_relation Fix stale secure_table_provision config (node_type/node_data -> nodes). Add database_extension to META_TABLE_ORDER (was in config but missing from order, causing it to be excluded from migration file output). Update all three export paths: - META_TABLE_CONFIG + META_TABLE_ORDER in export-utils.ts - SQL flow queryAndParse calls in export-meta.ts - GraphQL flow queryAndParse calls in export-graphql-meta.ts Update tests to accommodate node_type_registry (no uuid id) and blueprint_template (no database_id).
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Remove non-module tables that were incorrectly added: - node_type_registry, spatial_relation (metaschema_public) - blueprint, blueprint_construction, blueprint_template - database_extension from META_TABLE_ORDER Keep only modules (*_module) and provisions (*_provision) needed to run applications.
Add spatial_relation table (metaschema_public) to META_TABLE_ORDER, META_TABLE_CONFIG, and both SQL/GraphQL export flows. This table tracks PostGIS spatial relationships between tables for the graphile-postgis plugin.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add 15 missing tables to the pgpm export configuration so
pgpm exportproperly exports all module/provision data needed to run applications, plus PostGIS spatial relationship metadata. Also fix a stale column reference insecure_table_provision.Tables added:
metaschema_modules_public:billing_module,billing_provider_module,devices_module,identity_providers_module,notifications_module,plans_module,rate_limits_module,realtime_module,session_secrets_module,storage_module,webauthn_auth_module,webauthn_credentials_moduleentity_type_provision,relation_provisionspatial_relation(PostGIS cross-table spatial relationships for graphile-postgis)Bugfix:
secure_table_provisionconfig updated from stalenode_type/node_datato currentnodescolumn.Files:
export-utils.ts,export-meta.ts,export-graphql-meta.ts,export-utils.test.tsReview & Testing Checklist for Human
spatial_relationfield list matches the actual DB schema (id, database_id, table_id, field_id, ref_table_id, ref_field_id, name, operator, param_name, category, module, scope, tags)pgpm exportagainst a database with spatial relations and verify the spatial_relation rows appear in the output migrationsecure_table_provisionexports thenodescolumn correctly (was previouslynode_type/node_data)Notes
database_extensionremains inMETA_TABLE_CONFIG(for data resolution) but intentionally excluded fromMETA_TABLE_ORDER(not written to migration files)buildDynamicFields()at runtime, so extra fields in config that don't exist in a particular DB are safely ignoredLink to Devin session: https://app.devin.ai/sessions/f42f42528fb0465684159227efbef017
Requested by: @pyramation