Skip to content

feat(pgpm/export): add missing module tables + spatial_relation to export config#1133

Merged
pyramation merged 3 commits into
mainfrom
feat/add-missing-pgpm-export-tables
May 11, 2026
Merged

feat(pgpm/export): add missing module tables + spatial_relation to export config#1133
pyramation merged 3 commits into
mainfrom
feat/add-missing-pgpm-export-tables

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

@pyramation pyramation commented May 11, 2026

Summary

Add 15 missing tables to the pgpm export configuration so pgpm export properly exports all module/provision data needed to run applications, plus PostGIS spatial relationship metadata. Also fix a stale column reference in secure_table_provision.

Tables added:

  • 13 module tables from 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_module
  • 2 provision tables: entity_type_provision, relation_provision
  • 1 metaschema_public table: spatial_relation (PostGIS cross-table spatial relationships for graphile-postgis)

Bugfix: secure_table_provision config updated from stale node_type/node_data to current nodes column.

Files: export-utils.ts, export-meta.ts, export-graphql-meta.ts, export-utils.test.ts

Review & Testing Checklist for Human

  • Verify spatial_relation field 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)
  • Run pgpm export against a database with spatial relations and verify the spatial_relation rows appear in the output migration
  • Confirm secure_table_provision exports the nodes column correctly (was previously node_type/node_data)

Notes

  • database_extension remains in META_TABLE_CONFIG (for data resolution) but intentionally excluded from META_TABLE_ORDER (not written to migration files)
  • All new tables use buildDynamicFields() at runtime, so extra fields in config that don't exist in a particular DB are safely ignored

Link to Devin session: https://app.devin.ai/sessions/f42f42528fb0465684159227efbef017
Requested by: @pyramation

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).
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

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.
@devin-ai-integration devin-ai-integration Bot changed the title feat(pgpm/export): add 19 missing module tables to export config feat(pgpm/export): add missing module and provision tables to export config May 11, 2026
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.
@devin-ai-integration devin-ai-integration Bot changed the title feat(pgpm/export): add missing module and provision tables to export config feat(pgpm/export): add missing module tables + spatial_relation to export config May 11, 2026
@pyramation pyramation merged commit 7d6fb35 into main May 11, 2026
54 checks passed
@pyramation pyramation deleted the feat/add-missing-pgpm-export-tables branch May 11, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant