2
votes

I was reading the doc about Flyway and I found that :

If you have an existing database that has not been filled by Flyway this is the way to go:

- Create an initial migration script that will recreate your current state and give it a low version number.
- Use flyway:init to create the metadata table and set this script as the current version.

And my question is, can I init the metadata table with a specific version ?

Something like that :

<bean id="flyway" class="com.googlecode.flyway.core.Flyway" init-method="migrate">
    <property name="dataSource" ref="dataSource" />
    <property name="initOnMigrate" value="true" />
    <property name="initVersion" value="1.35" />
</bean>

Under the db/migration folder, I have some sql scripts from 1.0 to 1.49 ; The prod is in 1.35. The aim is to init the prod version in 1.35 without creating an initial migration script (I can't make it for several reasons...) and apply sql scripts from 1.36 to 1.49 during the migration.

Is it possible ?

1

1 Answers

2
votes

Yes. Exactly as you described.