feat(compare-schema): ci check to make sure schema.ts never goes out of sync with migrations#2449
Merged
icecrasher321 merged 3 commits intostagingfrom Dec 18, 2025
Merged
Conversation
…of sync with migrations
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryAdded a CI check to prevent
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant GH as GitHub Actions
participant WD as Working Directory
participant DK as drizzle-kit
participant Schema as schema.ts
participant Mig as migrations/
GH->>WD: cd packages/db
GH->>DK: bunx drizzle-kit generate
DK->>Schema: Read schema.ts
DK->>Mig: Generate migration files
Note over DK,Mig: Creates .sql and .json snapshots
GH->>WD: git status --porcelain ./migrations
alt Changes detected
WD-->>GH: Modified files found
GH->>GH: echo error message
GH->>GH: git diff ./migrations
GH->>GH: exit 1 (fail CI)
else No changes
WD-->>GH: Clean status
GH->>GH: echo success message
GH->>GH: Continue workflow
end
|
This reverts commit 9771f66.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Prevent schema.ts and migrations snapshots/sql files from going out of sync.
Type of Change
Testing
Tested manually.
Checklist