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 [initOnMigrate, initVersion] should use initVersion when the schema does not exist #842
Comments
Thanks for adding to 3.1, Axel. This is going to be very slick for our implementation, all that will be required is one command (migrate) to both init and migrate. Makes automation over deployment, developer machines and test environments that much simpler and true to Flyways motto. Exciting times. |
Hi Axel, So I had some time over the weekend to take a look into this, it looks like this line:
influences what will happen in the following By relaxing that At the moment I can't think of legitimate scenarios that dropping this condition will adversely impact. So far my testing has had the desired effects and the unit tests are still passing. If anything, seems like the I'd like to hear any of your thoughts before I start pushing on with additional unit tests to validate this approach. |
@axelfontaine Care to comment? I'd like to assist the 3.1 release with a PR addressing this, I have an vested interest :) |
HI Mark, sorry for the late reply. This somehow fell off my radar. I'm looking into this today. Cheers |
This is now fixed. Under normal circumstances I would have gladly taken a PR. However, since I had the init -> baseline change coming, this would have caused you more trouble than it would have been worth. Cheers P.S.: Feel free to give the new release a spin and check if it all works for you. |
Hey Axel, Tested and looks to work as expected, thanks a lot! Mark |
My setup currently has flyway managing one schema, the one which
schema_version
is held in egmigration.schema_version
. No other tables will exist in this schema, flyway is completely isolated.It seems like
migrate -initOnMigrate=true -initVersion=10 schemas=migration
should also honourinitVersion
when the configured schema does not exist. My experiments seem to show that executing this command on an existing database (devoid ofmigration
of course) will create the schema but then try to migrate forwards over all migrations, ignoring theinitVersion
.The effect of this is of course failures when attempting to run migrations against an already 'bootstrapped' but non-flyway-integrated database.
The text was updated successfully, but these errors were encountered: