Replies: 1 comment
-
That is currently expected behavior. All unapplied migrations will be applied. Dbmate encourages date-based migration versioning because during development they are not always created in monotonic order. There is some further discussion happening here: #441 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I've got a question about version processing by dbmate.
Let's assume 'schema_migrations' table of the actual database contains only one row:
002
and I would like to apply to this database three migration files:
001_migrations.sql
002_migrations.sql
003_migrations.sql
I initially expected that dbmate would apply only migration files which versions are higher than the one
in 'schema_migrations', i.e. in the case above it would apply only one file:
003_migrations.sql
And 'schema_migrations' would then contain only one row - updated version:
003
But in fact two migration files are applied:
001_migrations.sql
003_migrations.sql
because their versions are missing in 'schema_migrations' table.
And after applying migration files 'schema_migrations' table contains all versions:
002
001
003
Is it possible to configure dbmate so it would apply only migration files with the versions higher than the one in the database?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions