Wheels 4.0.2 released — migration reconciliation for shared dev databases, native apt/yum repos #2826
bpamiri
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Wheels 4.0.2 is out, a week after 4.0.1. It's a patch release (no breaking changes), and unlike the broad 4.0.1 shakeout it has a clear center of gravity: the database migrator.
Migrations on a shared dev database. The
wheels_migrator_versionstracking table records which migrations have run. When a team shares one development database, that table can drift from the files in your checkout — a teammate applies a migration, the version gets recorded, but the file isn't on your branch yet. We call that an orphan version. Before 4.0.2, an orphan at the top of the table fooledwheels migrate latestinto thinking you were rolling back, so it silently did nothing. Now the migrator detects orphans, warns you (naming the versions), and applies your pending local migrations instead.There are also three new reconciliation subcommands, modeled on Flyway's validate/repair:
wheels migrate doctor— a read-only health report: orphan versions, pending migrations, applied count. Prints yellow when something needs attention.wheels migrate forget <version> --yes— removes a stale tracking row without runningdown()(refuses if a matching file exists).wheels migrate pretend <version> --yes— records a version as applied without runningup()(refuses if already applied or no file matches).Both
forgetandpretendare dry-run unless you pass--yes. The tracking table also gainednameandapplied_atcolumns (added automatically on upgrade) somigrate infocan show you what an orphan was and when a peer applied it.Other highlights:
up()/down()could vanish because Model opened a nested transaction on top of the migrator's outer one. The migrator now signals ownership and Model skips the nested transaction.t.references()andt.primaryKey()now acceptcolumnNameslike every other column helper (the legacyreferenceNames/nameforms still work).wheels upgrade checkgained an advisory tier — opt-in recommendations separate from breaking-change warnings.key,order,group) now work inSELECT/GROUP BY, not justWHERE/ORDER BY.apt install wheels/dnf install wheels,apt upgrade wheels/dnf upgrade wheels— no GitHub-release download step.Upgrade with
brew upgrade wheels,scoop update wheels,apt upgrade wheels, ordnf upgrade wheels. No code changes required.Full release notes: https://blog.wheels.dev/posts/wheels-4-0-2-released
Beta Was this translation helpful? Give feedback.
All reactions