Skip to content

fix: remove dbname from sites and apis export config#711

Merged
pyramation merged 1 commit intomainfrom
devin/1770944750-remove-dbname-from-export
Feb 13, 2026
Merged

fix: remove dbname from sites and apis export config#711
pyramation merged 1 commit intomainfrom
devin/1770944750-remove-dbname-from-export

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

fix: exclude dbname from sites and apis export config

Summary

Removes dbname from the sites and apis field configs in export-meta.ts so that generated migration INSERT statements no longer include this column.

The dbname column on both services_public.sites and services_public.apis has DEFAULT current_database(). During introspection, the test database receives a random name (e.g. db-<uuid>), so each regeneration produces a different dbname value in the exported SQL — causing non-deterministic diffs like:

-  'db-36872286-e08e-45ad-b233-dc528a2a44e7'
+  'db-82d5fdf2-499d-4b03-9ef5-f4322005352a'

With dbname removed from the config, the column is omitted from generated INSERTs entirely. At deploy time, current_database() provides the correct value via the column DEFAULT.

Review & Testing Checklist for Human

  • Verify that no deployment scripts or runtime code depend on dbname being explicitly present in the migration INSERT statements (rather than relying on the column DEFAULT)
  • After publishing this version, regenerate migrations in constructive-db and confirm apis.sql / sites.sql no longer contain dbname and produce stable output across runs
  • Check that the csv-to-pg Parser correctly omits columns not listed in fields (i.e., confirm SELECT * rows with extra columns don't cause errors when dbname is absent from the config)

Notes

  • This only fixes the upstream package (@pgpmjs/core). The constructive-db repo will need its dependency updated and migrations regenerated to see the effect.
  • Link to Devin run
  • Requested by: @pyramation

The dbname column has DEFAULT current_database() which captures the
random test database name during introspection, causing non-deterministic
output in generated migration files (apis.sql, sites.sql).

By removing dbname from the export config, the generated INSERT statements
won't include this column, and it will use its DEFAULT at deploy time.
@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

@pyramation pyramation merged commit 8749fd0 into main Feb 13, 2026
52 checks passed
@pyramation pyramation deleted the devin/1770944750-remove-dbname-from-export branch February 13, 2026 02:22
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