Skip to content

chore: schema update (mar-26) + fix migrate-client index.ts preservation#906

Merged
pyramation merged 3 commits into
mainfrom
devin/1774516309-schema-update-with-fix
Mar 26, 2026
Merged

chore: schema update (mar-26) + fix migrate-client index.ts preservation#906
pyramation merged 3 commits into
mainfrom
devin/1774516309-schema-update-with-fix

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

@pyramation pyramation commented Mar 26, 2026

Summary

Combines the automated schema update from constructive-db@c72ec069 (PR #904) with a fix for the build-breaking bug it introduced (PR #905).

Schema changes (auto-generated):

  • SqlMigrationSqlAction (rename across all SDK targets)
  • FieldModule removed
  • MigrateFile added
  • Updated schemas, input types, ORM models, CLI commands, and React hooks accordingly

Build fix (generate-migrate-client.ts + package.json):

  • The pregenerate:migrate-client script was deleting src/index.ts (the package entry point), and generateMulti only writes a root barrel for multi-target outputs — so the single-target migrate-client never got it back. This broke pgpm/export which imports @pgpmjs/migrate-client.
  • Removed ../migrate-client/src/index.ts from the rimraf glob
  • Added a post-codegen step in generate-migrate-client.ts to write the root barrel as a safety net

Updates since last revision:

  • Explicitly restored sdk/migrate-client/src/index.ts (export * from './migrate') on this branch so the build fix takes effect immediately — not just on the next generate:migrate-client run.

Review & Testing Checklist for Human

  • Verify the SqlMigrationSqlAction rename is complete. The CLI usage string in commands.ts is auto-generated and very long — confirm it references sql-action (not sql-migration). Also grep for any leftover SqlMigration / sqlMigration / sql_migration references in non-generated code (especially pgpm/export/src/export-graphql.ts which uses db.sqlAction.findMany).
  • Verify the FieldModule removal is intentional and no code outside the generated SDK still references it.
  • After merging, re-run the constructive-hub schema-propagation CI to confirm the full pipeline (pgpm deploy → SDL generation → codegen) passes end-to-end. This is the real integration test for the index.ts fix.

Notes

  • The vast majority of this diff is auto-generated codegen output. Focus review on the two hand-written files: sdk/constructive-sdk/package.json (line 29) and sdk/constructive-sdk/scripts/generate-migrate-client.ts (new lines 9-10, 70-81).
  • sdk/migrate-client/src/index.ts is now present in the branch (net zero diff vs. main since it was deleted by chore: update schemas from constructive-db (mar-26-139am) #904 and restored). The generate script safety net ensures future regenerations won't lose it again.
  • The path.resolve(OUTPUT_DIR, 'index.ts') in the generate script resolves relative to sdk/constructive-sdk/ (the pnpm working directory), so it should correctly target sdk/migrate-client/src/index.ts.

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

github-actions Bot and others added 2 commits March 26, 2026 08:50
Auto-generated by schema-propagation workflow.
Source: constructive-db@c72ec069
The pregenerate:migrate-client script was deleting src/index.ts along
with the generated src/migrate/ directory. Since generateMulti only
writes a root barrel when there are multiple targets, the single-target
migrate-client never got its index.ts regenerated — breaking any
consumer that imports @pgpmjs/migrate-client.

Two fixes:
1. Remove src/index.ts from the rimraf in pregenerate:migrate-client
2. Have generate-migrate-client.ts write the root barrel after codegen
   as a safety net (matching the multi-target pattern)
@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 4ad48e4 into main Mar 26, 2026
43 checks passed
@pyramation pyramation deleted the devin/1774516309-schema-update-with-fix branch March 26, 2026 09: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