You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an 'ignorePendingMigrations' option to suppress validation errors caused by the availability of not-yet-applied migrations.
My use case is for a CI/CD pipeline - while developers are working on a feature branch they should be able to create and modify migrations for that feature. However, we should be able to detect and break the build when changes are made to versioned migrations that have already been applied to (e.g.) our production database. Running flyway validate with ignorePendingMigrations=true would support this scenario and be consistent with the existing ignore*Migrations options.
The text was updated successfully, but these errors were encountered:
@axelfontaine-target=current doesn't seem to work in exactly the same way in the presence of out-of-order migrations. E.g. if I run flyway -target=current -ignoreIgnoredMigrations=true -ignoreFutureMigrations=true -outOfOrder=true validate then I can still get "Detected resolved migration not applied" errors. This happens when running with a migration set with a new migration ordered before the current DB version, which can occur when team members work on feature branches that overlap in time. When running with the proposed ignorePendingMigrations=true option the validation works as expected.
Hmm, the right configuration for my use case seems to be to use -ignoreIgnoredMigrations=true -outOfOrder=false which isn't super intuitive. I think one source of difficulty is that the documentation mostly assumes a very linear, serialised version history (corresponding to application release versions), and its examples don't often apply to scenarios where a team creates migrations in a distributed, parallel way (as application features are developed).
Versioned migrations aside, I can't find any combination of existing flags that will pass validation with changes to a repeatable migration. It seems that might only be achievable with an ignorePendingMigrations option, @axelfontaine?