Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
  <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
     <property name="driverClassName" value="${jdbc.driverClassName}" />
     <property value="${jdbc.url}" />
     <property value="${jdbc.username:root}" />
     <property value="${jdbc.password:root}" />
   </bean>

    <bean class="org.jtalks.common.util.FlywayWrapper" init-method="smartInit" depends-on="dataSource">
         <property name="dataSource" ref="dataSource"/>
         <property name="basePackage" value="org.jtalks.common.migrations"/>
         <property value="/org/jtalks/common/migrations"/>
         <property value="common_schema_version"/>
         <property value="${migrations_enabled}"/>
     </bean>

    <bean class="org.jtalks.common.util.FlywayWrapper" init-method="migrate" 
          depends-on="flyway_common_init">
         <property name="dataSource" ref="dataSource"/>
         <property name="basePackage" value="org.jtalks.common.migrations"/>
         <property value="/org/jtalks/common/migrations"/>
         <property value="common_schema_version"/>
         <property value="${migrations_enabled}"/>
     </bean>

    <bean class="org.jtalks.common.util.FlywayWrapper" init-method="smartInit"
           depends-on="flyway_common">
         <property name="dataSource" ref="dataSource"/>
         <property value="poulpe_schema_version"/>
         <property value="${migrations_enabled}"/>
     </bean>

    <bean class="org.jtalks.common.util.FlywayWrapper" init-method="migrate" 
          depends-on="flyway_poulpe_init">
         <property name="dataSource" ref="dataSource"/>
         <property name="basePackage" value="org.jtalks.poulpe.migrations"/>
         <property value="/org/jtalks/poulpe/migrations"/>
         <property value="poulpe_schema_version"/>
         <property value="${migrations_enabled}"/>
     </bean>

Our beans require data source instance and we have the next init chain:

...

  1. flyway_common_init bean created and make Flyway.init() if there is no common metadata table in the specified schema and if smartInit is enabled.
  2. flyway_common created and call Flyway.migrate() if enabled property is True.
    Applying Poulpe schema migrations
  3. flyway_poulpe_init bean created and make Flyway.init() if there is no poulpe metadata table in the specified schema and if smartInit is enabled.
  4. flyway_poulpe_init created and call Flyway.migrate() if enabled property is True.

...