-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ToApply doesn't consider IgnoreUnknown flags when apply migrations up dir #240
Comments
It's possible to use the // sql-migrate version 1.3.1
ms := migrate.MigrationSet{TableName: "my_library_migrations"}
m := migrate.HttpFileSystemMigrationSource{FileSystem: http.FS(migrations.FS)}
ms.ExecMax(db, "postgres", m, migrate.Up, 1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context
Imagine a
project
with its migrations, and it has its command to apply it. Now, you have installed libraryfoo
that applies migrations also with its CLI (knowing that the library has the flagIgnoreUnknown
set totrue
when applying its migrations).Problem
If you apply the
project
migrations and then try to run the migrations for thelibrary
,sql-migrate
will consider that all migrations from the library were already applied since it does not consider theIgnoreUnknown
flag when getting therecord
that contains the last applied migration:https://github.com/rubenv/sql-migrate/blob/master/migrate.go#L609-L613
It results in not applying the library migrations.
Example
It shouldn't print an empty array since none of the Library migrations was applied.
Expect
I expect the library's migrations to be applied.
The text was updated successfully, but these errors were encountered: