Skip to content

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Jan 3, 2026

Summary

Updates hardcoded PostgreSQL schema names in the pgpm export functionality to match the schema rename in constructive-db PR #216:

  • collections_publicmetaschema_public (database metadata tables)
  • meta_publicservices_public (service tables like apis, sites, domains)
  • rls_module and user_auth_modulemetaschema_modules_public (module configuration tables)

Also updates the default schemas array in get-graphql-schema.ts to use the new schema names.

This is a breaking change that must be coordinated with the constructive-db rename.

Files changed:

  • pgpm/cli/src/commands/export.ts - SQL queries for database/schema selection
  • pgpm/core/src/export/export-meta.ts - Table config and SQL queries for metadata export
  • pgpm/core/src/export/export-migrations.ts - SQL queries and comments in migration export
  • pgpm/core/__tests__/export/export-flow.test.ts - Test fixtures updated to use new schema names
  • pgpm/core/__tests__/export/export-meta.test.ts - Test assertions updated for new schema names
  • packages/cli/src/commands/get-graphql-schema.ts - Default schemas array updated
  • __fixtures__/output/ - Schema fixture files renamed and modules_public.ts removed

Updates since last revision

  • Updated rls_module and user_auth_module to use metaschema_modules_public schema (matching constructive-db PR [DONT MERGE] change listModules #216)
  • Updated get-graphql-schema.ts default schemas: removed dashboard_public, added metaschema_modules_public
  • Fixed export-flow.test.ts to create metaschema_modules_public schema and move module tables there
  • Updated export-meta.test.ts to separate module tables into their own test section

Review & Testing Checklist for Human

  • CRITICAL: Verify the pg-ast file changes (version 1.30.2 → 1.30.4 in asts.ts and wrapped.ts) are intentional - these are auto-generated files and the version bump appears unrelated to the schema rename. Consider reverting if accidental.
  • Verify metaschema_modules_public schema exists in target database before deploying (created by constructive-db PR [DONT MERGE] change listModules #216)
  • Grep for any remaining old schema references: grep -r "collections_public\|meta_public\|dashboard_public" pgpm/ packages/cli/
  • Verify deployment order: constructive-db PR [DONT MERGE] change listModules #216 must be deployed FIRST, then this PR

Recommended test plan:

  1. Deploy constructive-db PR [DONT MERGE] change listModules #216 to a test database
  2. Run pgpm export against the test database to verify queries work with new schema names
  3. Verify exported SQL files reference the correct schema names (metaschema_public, services_public, metaschema_modules_public)

Notes

This PR consolidates the schema rename changes for the rename/develop branch. Part of the massive schema rename effort documented in docs/plan/NAMING-PROPOSAL.md in constructive-db.

Link to Devin run: https://app.devin.ai/sessions/218e681281f94c7b8c18e5a110f5f995
Requested by: Dan Lynch (@pyramation)

@devin-ai-integration
Copy link
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

… services_public)

- Rename collections_public -> metaschema_public in export-flow.test.ts
- Rename meta_public -> services_public in export-flow.test.ts
- Delete modules_public.ts fixture
- Rename fixture schema files to match new names
- Change rls_module and user_auth_module schema from services_public to metaschema_modules_public
- Update queries to use metaschema_modules_public.rls_module and metaschema_modules_public.user_auth_module
- Add metaschema_modules_public to default schemas array in get-graphql-schema.ts
- Fix default schemas: collections_public -> metaschema_public, add services_public
- Update export-meta.test.ts to reflect new schema locations
@pyramation pyramation merged commit 55dbb21 into main Jan 5, 2026
36 checks passed
@pyramation pyramation deleted the rename/develop branch January 5, 2026 05:16
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.

2 participants