Skip to content

feat: support drizzle v1 folder migrations#5027

Draft
avallete wants to merge 11 commits intodevelopfrom
feat/drizzle-folder-migrations
Draft

feat: support drizzle v1 folder migrations#5027
avallete wants to merge 11 commits intodevelopfrom
feat/drizzle-folder-migrations

Conversation

@avallete
Copy link
Copy Markdown
Member

@avallete avallete commented Apr 2, 2026

What kind of change does this PR introduce?

Bug fix, feature, docs update, ...

What is the current behavior?

Please link any relevant issues here.

What is the new behavior?

Feel free to include screenshots if it includes visual changes.

Additional context

Add any other context or screenshots.

avallete and others added 11 commits March 20, 2026 19:33
…wMigrationFromFile

Add foundational helpers for Drizzle v1 folder-based migration support:
- ParseVersion: extracts version/name from flat files or folder-based paths
- MigrationName: returns human-readable display name for migration paths
- migrateDirPattern: regex for matching directory names
- NewMigrationFromFile: now uses ParseVersion for both flat and folder paths
Replace the unconditional `continue` on directories with logic that checks
if the directory name matches the migration timestamp pattern and contains
a `migration.sql` file (Drizzle v1 folder format).
…ions and ApplyMigrations

Replace direct migrateFilePattern regex call with ParseVersion to handle
both flat-file and folder-based migration paths; use MigrationName for
display output. Removes path/filepath import no longer needed.
…grations

filepath.Base would return just "migration.sql" for folder-based migrations,
losing the version identity in debug output.
Show version number in error instead of only the flat-file glob pattern.
@coveralls
Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 23953469768

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 17 of 23 (73.91%) changed or added relevant lines in 4 files are covered.
  • 5 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.02%) to 63.187%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/migration/repair/repair.go 13 15 86.67%
internal/migration/squash/squash.go 2 6 33.33%
Files with Coverage Reduction New Missed Lines %
internal/utils/git.go 5 57.14%
Totals Coverage Status
Change from base Build 23953325273: -0.02%
Covered Lines: 9231
Relevant Lines: 14609

💛 - Coveralls

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