Fix export-meta.ts: correct table name and add missing field query #471
+270
−1
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
Fixes two bugs in the
pgpm exportcommand's meta_public schema export:Table name typo: Changed
database_extensions(plural) todatabase_extension(singular) in the config. The query was already using the correct singular form, but the config used plural, causing generated INSERT statements to target a non-existent table.Missing field query: The
fieldtable was defined in the config but never actually queried. Added the missingqueryAndParse('field', ...)call.Updates since last revision
csv-to-pglibrary (ast.ResTarget is not a function). This is unrelated to the bug fixes in this PR.pgpm/core/__tests__/export/remain and verify the bug fixes.Review & Testing Checklist for Human
collections_public.database_extension(singular) is the actual table name in db-meta-schemapgpm exportagainst a database with db-meta-schema deployed and verify the generated SQL is validRecommended test plan: Deploy db-meta-schema to a test database, seed some data, run
pgpm export, and attempt to replay the generated SQL in a fresh database.Notes
The tests in this PR are static config validation tests that read the source file and verify the config structure. They do not require a database connection. Full integration testing of
exportMeta()is blocked by a pre-existingcsv-to-pgcompatibility issue that should be addressed separately.Additional issues documented in plan.md that may need follow-up:
user_auth_moduleconfigsite_metadatatableLink to Devin run: https://app.devin.ai/sessions/77df3b12408140e597019f53283de49c
Requested by: Dan Lynch (@pyramation)