0

the basic configurations of flywaydb is working great, i have 2 sets of properties one component specific and another environment specific, I have placed component specific under db/migration(default) and i have environment specific that comes from another dependency component and all those scripts are under folders like

/dev/scripts
/test/scripts
/prod/scripts

how do i pass value to the location property of both db/migration(component specific) and above(env specific) locations dynamically

<bean class="org.flywaydb.core.Flyway" init-method="migrate">
    <property name="dataSource" ref="dataSource" />
    <property name="locations" value="?" />
    <property name="initOnMigrate" value="true" />
</bean>
gnanesh
  • 321
  • 1
  • 3
  • 12
  • Duplicate of http://stackoverflow.com/questions/13528250/inject-array-of-strings-to-a-bean-in-spring – Axel Fontaine Sep 21 '14 at 11:25
  • i provided like below, – gnanesh Sep 22 '14 at 12:41
  • i am feeding like and i have V001_update.sql in dev/scripts folder and when i try to deploy i am seeing Caused by: org.flywaydb.core.api.FlywayException: Found more than one migration with version '001'. by the way i have V1_xxx.sql file under db/migration, so does it treat V001 and V1 as same ? – gnanesh Sep 22 '14 at 13:12
  • Yes, versions are treated numerically. Dot notation is supported. – Axel Fontaine Sep 22 '14 at 13:14
  • sure let me update it and see, by the way when i have comma separated locations, which scripts will execute first ? – gnanesh Sep 22 '14 at 13:38
  • i gave V1.1__update.sql and its failing with Wrong migration name format: V1.1_update.sql(It should look like this: V1_2__Description.sql), here is what i have in both the components, dev/scripts - V1.1__update.sql db/migration - V1_1__xxx.sql – gnanesh Sep 22 '14 at 14:06
  • i see version is maintained but how do i achieve below scenario, my components are 1 Common, 1 Customer, 2 Sales Order , both Customer and Sales Order uses Common now here is how my files will looks like in each Common - V2009__update.sql Customer - V1__customer.sql Sales - V1__sales.sql i am sure it will complain about "Found more than one migration with version V1",what's the workaround for this ? – gnanesh Sep 22 '14 at 17:48

0 Answers0