Skip to content

fix(export): change field.type from text to jsonb in META_TABLE_CONFIG#1233

Merged
pyramation merged 1 commit into
mainfrom
feat/export-field-type-jsonb
May 29, 2026
Merged

fix(export): change field.type from text to jsonb in META_TABLE_CONFIG#1233
pyramation merged 1 commit into
mainfrom
feat/export-field-type-jsonb

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

metaschema_public.field.type is now a jsonb column (FieldType objects like {"name":"uuid"}). The META_TABLE_CONFIG in @pgpmjs/export still had type: 'text' for this column, which caused csv-to-pg's text coercion handler to call String() on JS objects — producing [object Object] in generated SQL INSERT statements.

One-line fix: type: 'text'type: 'jsonb' in the field table config.

Root cause: The old patch (patches/@pgpmjs__export@0.19.0.patch) in constructive-db applied this fix, but it was never upstreamed into the source. When @pgpmjs/export was bumped to 0.19.1, the patch became stale and was removed, exposing the bug.

Review & Testing Checklist for Human

  • After publishing, re-run the constructive-db dep update workflow — the generate CI job should produce valid JSON strings instead of [object Object] for field type values
  • Verify the generated migrate/field SQL has proper JSON like '{"name":"uuid"}' instead of '[object Object]'

Notes

Blocks constructive-db#1405 — once this is published, that PR's CI should pass.

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

metaschema_public.field.type is now a jsonb column (FieldType objects).
The text coercion hint caused csv-to-pg to call String() on JS objects,
producing [object Object] in generated SQL INSERT statements.
@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, CI, and merge conflict monitoring

@pyramation pyramation merged commit a6b3dfc into main May 29, 2026
37 checks passed
@pyramation pyramation deleted the feat/export-field-type-jsonb branch May 29, 2026 03:52
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