-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Migrate.Up() errors out if the latest schema is in use #100
Comments
Have you asserted that |
@dhui Oh man, I didn't even see that! I'm sorry. That fixes it! |
I'm sorry, but I still don't see how "no change" should be an error. And checking the error for a certain type does not seem like the right solution to me here. Is there any specific reason it is done like that? From my understanding it could just be logged away. |
This decision predates me.
This pattern is also used in the io.Reader interface e.g. io.EOF
Unfortunately, logging in Go leaves a lot to be desired. e.g. every package has their own way of handling logging... Until there's a standard configurable way to log messages at different levels, |
Migrate.Up() errors out if the currently active schema matches the latest schema version.
Steps to Reproduce
My migrations look like this:
1_initialize_tables.down.sql
1_initialize_tables.up.sql
I have code that looks like this:
And I get the error:
Expected Behavior
I would expect Migrate.Up() to not return an error if the latest schema is in use. At minimum it should return an
ErrAlreadyUpToDate
or something similar. If this is not the intended use of this method, better documentation should be made to demonstrate how this functionality is best achieved with the current migrate API.Migrate Version
v3.5.1 - Go Client
Loaded Source Drivers
file
Loaded Database Drivers
spanner
Additional context
I've ran Migrate.Up() once which created an entry in the SchemaMigrations table and a row now exists that looks like this:
The second time I start my service up Migrate.Up() fails because the currently active version is the latest one.
The text was updated successfully, but these errors were encountered: