Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Drizzle-kit]: Add "squash" command to CLI#4927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
isaacwasserman wants to merge2 commits intodrizzle-team:main
base:main
Choose a base branch
Loading
fromisaacwasserman:feat/migration-squash

Conversation

@isaacwasserman
Copy link

@isaacwassermanisaacwasserman commentedSep 17, 2025
edited
Loading

This commit adds a 'squash' command to the drizzle-kit cli. This command allows users to combine a range of consecutive migrations. Squashing is particularly useful for cleaning up feature branches developed over multiple iterations that include many small, redundant, or contradictory migrations.

Changes:

  • Adds squash command to CLI schema
  • Implementssquash command
    • Takes two custom argumentsstart (i) andend (j) representing the inclusive range of migrations to be merged
    • Combines migrations
      • Concatenates SQL files
      • Updates journal entryi to use snapshot from migrationj
      • Removes journal entriesi+1-j
      • Removes unused sql and snapshots
  • No pre-existing code is modified or deleted
  • Integration tests are included to ensure:
    • Basic functionality of CLI
    • Compatibility with existinggenerate andmigrate commands

Note:
Thesquash command has a single known (and intentional) failure case when some environment has been migrated to versioni < k < j.

Related issues/discussions:#2859#4897#3492

boredland, jenslys, CyanCX2, cmanou, lukaspili, v3ceban, and pixelsize reacted with thumbs up emoji
This commit adds a 'squash' command to the drizzle-kit cli. This command allows users to combine a range of consecutive migrations. Squashing is particularly useful for cleaning up feature branches developed over multiple iterations that include many small, redundant, or contradictory migrations.
Cleaned up code formatting and style using prettier and eslint
@isaacwassermanisaacwasserman marked this pull request as ready for reviewSeptember 17, 2025 21:15
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@isaacwasserman

[8]ページ先頭

©2009-2025 Movatter.jp