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
The default state in goose is to ignore out-of-order migrations. If you subscribe to hybrid versioning approach then this will not affect you because out-of-order migrations aren't possible.
The intended behaviour for goose should be to detect older, unapplied, migrations and error if any are found.
To illustrate an example, suppose migration 1 and 4 are applied and then version 2 and 3 are introduced. Today goose will ignore version 2 and 3.
Database: goose_db_version
| version_id | is_applied |
|------------|------------|
| 0 | t |
| 1 | t |
| 4 | t |
commands below abbreviated
$ goose status
Applied At Migration
=======================================
Sat Oct 16 12:56:26 2021 -- 00001_a.sql
Pending -- 00002_b.sql
Pending -- 00003_c.sql
Sat Oct 16 12:56:26 2021 -- 00004_d.sql
$ goose up
goose: no migrations to run. current version: 4
$ goose up-by-one
goose: no migrations to run. current version: 4
goose run: no next version found
The fix is to return an error if pending migrations are detected. This will be the default.
After this PR is merged In a single PR I'll add support for out-of-order migrations as described #262. That way folks are not blocked and have a flag (or option) to apply migrations.
EDIT: I suppose there will be some people that are happy to ignore those pending migrations, not to be confused with the folks that would like to apply out-of-order migrations. For the former we could add a "disable validation" or something. But I'd like for someone to raise an issue for that use-case.
The text was updated successfully, but these errors were encountered:
The default state in goose is to ignore out-of-order migrations. If you subscribe to hybrid versioning approach then this will not affect you because out-of-order migrations aren't possible.
The intended behaviour for
goose
should be to detect older, unapplied, migrations and error if any are found.To illustrate an example, suppose migration 1 and 4 are applied and then version 2 and 3 are introduced. Today
goose
will ignore version 2 and 3.Database:
goose_db_version
commands below abbreviated
The fix is to return an error if pending migrations are detected. This will be the default.
After this PR is mergedIn a single PR I'll add support for out-of-order migrations as described #262. That way folks are not blocked and have a flag (or option) to apply migrations.EDIT: I suppose there will be some people that are happy to ignore those pending migrations, not to be confused with the folks that would like to apply out-of-order migrations. For the former we could add a "disable validation" or something. But I'd like for someone to raise an issue for that use-case.
The text was updated successfully, but these errors were encountered: