Skip to content

Add a exclusion list to dynamic export#1259

Closed
NorOldBurden wants to merge 1 commit into
mainfrom
fix/dynamic-export-exclusion
Closed

Add a exclusion list to dynamic export#1259
NorOldBurden wants to merge 1 commit into
mainfrom
fix/dynamic-export-exclusion

Conversation

@NorOldBurden
Copy link
Copy Markdown
Contributor

No description provided.

@devin-ai-integration
Copy link
Copy Markdown
Contributor

Root-Cause Analysis

After tracing through the codebase, the diagnosis in this PR is incorrect and there's a bug in the fix. Closing in favor of a proper solution.

What's actually happening

The internal packages/metaschema (in constructive-db) calls db_utils.timestamps() on every metaschema_public table, which adds physical created_at/updated_at columns via ALTER TABLE ADD COLUMN. These are real database columns — not virtual or computed fields.

The published pgpm-modules/metaschema-schema does not include these columns in its CREATE TABLE statements. When the export tool introspects a server running the internal package (which has the physical columns), it generates INSERTs for those columns. When deployed against a database built from the published package (which lacks the columns) → failure.

TL;DR: This is a schema drift between the internal and published metaschema packages — not a stamps/computed-column issue.

Bug: lang_column exclusion

lang_column is a physical column defined in the published metaschema-schema for full_text_search:

CREATE TABLE metaschema_public.full_text_search (
    ...
    lang_column text,  -- this is a real column
    ...
);

Excluding it from export would cause data loss.

Unnecessary exclusions

The services_public and metaschema_modules_public tables don't have timestamp columns in either version — their GraphQL types don't expose createdAt/updatedAt. Adding excludeFields to those ~40 table configs is harmless but pointless.

The real fix

Update the published pgpm-modules/metaschema-schema to include the timestamp columns directly in the CREATE TABLE definitions, so the published schema matches what introspection sees at runtime. This eliminates the drift entirely without needing any excludeFields workaround.

@pyramation pyramation closed this Jun 5, 2026
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