Flyway SQL迁移忽略

时间:2018-12-06 09:39:08

标签: java spring maven flyway

我已经将pom的依赖性以及对xxx-servlet.xml的这种配置添加到了数据库中,并且当我在数据库架构中运行应用程序时,系统会自动创建新表“ flyway_schema_history”,但迁移脚本未运行,并且不会发生任何错误。

   <dependency>
            <groupId>org.flywaydb</groupId>
            <artifactId>flyway-core</artifactId>
            <version>5.2.4</version>
   </dependency>


<beans:bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
    <beans:property name="baselineOnMigrate" value="true" />
    <beans:property name="locations" value="WEB_INF/classes/db/migration"/>
    <beans:property name="dataSource" ref="db"/>
</beans:bean>

<beans:bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
    <beans:constructor-arg ref="flywayConfig"/>
</beans:bean>

<beans:bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"  depends-on="flyway">

0 个答案:

没有答案