Skip to content
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

baselineVersionAsString and baselineVersion ignored #1919

Closed
Webenius opened this issue Feb 8, 2018 · 2 comments
Closed

baselineVersionAsString and baselineVersion ignored #1919

Webenius opened this issue Feb 8, 2018 · 2 comments

Comments

@Webenius
Copy link

Webenius commented Feb 8, 2018

Hello everybody,

I'm using Postgresql 9.4, Flyway 5.0.0, Java 1.8 in a spring (not boot) application and I want that flyway does not execute the migrations < 1.5 (even if it is run for the first time on an existing db with no flyway_schema_history). But it executes always all the migrations and ignores the value of baselineVersionAsString:

<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
        <property name="baselineOnMigrate" value="true" />
        <property name="baselineVersionAsString" value="1.5" />
        <property name="dataSource" ref="dataSource" />
    </bean>

baselineVersion is ignored too:

<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
        <property name="baselineOnMigrate" value="true" />
        <property name="baselineVersion">
            <bean class="org.flywaydb.core.api.MigrationVersion">
                <constructor-arg value="5"></constructor-arg>
            </bean>
        </property>
        <property name="locations" value="classpath:db.migration" />
        <property name="dataSource" ref="dataSource" />
    </bean>

am I missing something or doing it wrong to get what I want? Any help will be appreciated.

Thanks

@axelfontaine
Copy link
Contributor

This works as designed. As stated in the docs:

Whether to automatically call baseline when migrate is executed against a non-empty schema with no metadata table.

Invoke baseline manually first or split the migrations across two locations and only load the one that is relevant here.

@axelfontaine axelfontaine removed this from the Flyway 5.1.0 milestone Feb 26, 2018
@bestNameEUWest
Copy link

Sorry but the documentation seems to be unclear here. I am in the same situation as @Webenius and according to the documentation we both have a non-empty schema (existing database) with no metadata table (no flyway_schema_history table I suppose?).

So flyway should only apply migrations > baselineVersion.

Is there something I don't understand here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants