score:1
Accepted answer
define a second flyway bean. then add to both flyway beans a different sqlmigrationprefix property and name your migration scripts accordingly.
for example
<bean class="com.googlecode.flyway.core.flyway" init-method="migrate">
<property name="datasource" ref="datasource1" />
<property name="sqlmigrationprefix" value="db1_" />
</bean>
<bean class="com.googlecode.flyway.core.flyway" init-method="migrate">
<property name="datasource" ref="datasource2" />
<property name="sqlmigrationprefix" value="db2_" />
</bean>
your migration scripts have to follow this naming scheme:
db1_1.0__initial_setup.sql
db1_1.1__new_column.sql
db2_1.0__initial_setup.sql
db2_1.1__new_column.sql
edit - configuration by code:
in your code you are having two flyway instances. this instances are equivalent to the definition as a spring bean. so you can call the following to achieve the same:
flyway.setsqlmigrationprefix("db1_");
flywaygen.setsqlmigrationprefix("db2_");
Source: stackoverflow.com
Related Query
- Multiple instances of Flyway pointing to different Datasources in Java application
- Running multiple instances of an application with different arguments using eclipse
- Start multiple instances of program with different parameters
- How to run multiple tomcat instances using different ports within MyEclipse IDE
- In Eclipse, can I have multiple Console views at once, each showing a different Console?
- How can we redirect a Java program console output to multiple files?
- How to run Eclipse with different Java version?
- How to reference a different Java project in Eclipse
- Different kind of Java EE projects
- Stop Eclipse/Java running multiple instances
- Java variable across multiple include blocks - variable cannot be resolved
- Eclipse: Multiple projects with same name but different location
- Possible to rename multiple Java packages in Eclipse with a single command?
- Eclipse in OS X uses different version of Java than CLI
- Run multiple java main methods in eclipse
- Is it possible to debug multiple threads in eclipse in different windows?
- Multiple Java installations in Mac OS X Mavericks
- How to use different line wrapping for strings and other items in Eclipse for Java
- set a (method) breakpoint for a particular object (and not all instances of that type) in java
- Setting different spaces for tab for Java and Scala in Eclipse
- Avoid the "no JREs installed in the workspace that are strictly compatible" warning in Eclipse for multiple Java versions
- Speeding up Android app building - Java compiler to use multiple CPU cores
- How to open multiple Spring STS instances on mac
- How do you handle different Java IDEs and svn?
- Generics function call not compiling in java 8 extending multiple interfaces
- Different color bars using multiple series
- Strange behavior with different java application export option
- Is there an Eclipse plugin that will let you diff a single Java method across multiple Subversion revisions?
- Multiple eclipses for different feature set or single eclipse contains all plug-ins?
- Why are Java comments different colors in Eclipse?
More Query from same tag
- Does Eclipse look like native GUIs?
- How to combine m2e and e(fx)clipse?
- how can I set the value Present Value in my class to be called into a Method
- Unable to find Deployment assembly Eclipse Juno
- SWT BrowserFunction not registering
- Play Services and AdMob: Expected 4132500 but found 4242000
- Is it possible to prevent Eclipse's indexer from presenting matches for `.class` files?
- "code formatting" commits into svn
- org.h2.jdbc.JdbcSQLException: Table "PACCHETTIVISITETURISTICHE" not found; SQL statement:
- Removing new lines before empty blocks in Eclipse
- Ubuntu 12.04 Eclipse Indigo wont start
- How do I exclude devices with no rear facing camera?
- JAVA REST jersy + Eclipse + MYSQL insert data into db
- Build Success | Not Getting any error in Maven Project in Eclipse but nothing is happening
- Spring MVC Annotations
- use of deleted functions in c++
- MD5 and Sh1 and debug keystrok in eclipse .?
- JUnit: Execute by Method and/or by Class and/or by Project?
- The method getString(int) is undefined for the type GamePlay
- Using an object in another object java
- Rational clearcase client integration with Eclipse
- Java eclipse run android project
- Chrome can not find function firefox and eclipse does
- How to find an instance constructor call in Java debug in Eclipse?
- python project dependencies with maven - modulenotfounderror: no module named 'yyy'
- Automatically run a webservice after git commit in eclipse
- MIME media type application/json was not found
- Adding Eclipse to Gnome Do
- How to write and compile a mixed programming language (C and FORTRAN) in Eclipse
- Could not open Selected VM debug port (8700) (Eclipse IDE)