1

I started using flyway and its easy , but i only tried it with one Database. setting flyway.url to that database Using flyway migrate from command line to execute all the scripts. This is the current Setting.

flyway.driver=net.sourceforge.jtds.jdbc.Driver

Jdbc url to use to connect to the database

flyway.url=jdbc:jtds:sqlserver://'databaseName'

User to use to connect to the database (default: <>)

flyway.user=user

Password to use to connect to the database (default: <>)

flyway.password=user

but i am having problem with multiple databases and scripts for each DB, how can i set flyway to migrate data to all the databases ? run separate schema for each ? can i add multiple databases info to the config file? what should i set my flyway.url to in the properties file

Richard
  • 14,798
  • 21
  • 70
  • 103
user1238330
  • 53
  • 2
  • 7
  • I asked a similar question but my conf was for maven plugin. You can take a look http://stackoverflow.com/questions/23545657/how-to-use-flyway-configuration-to-handle-multiple-databases – Federico Piazza Jun 03 '14 at 23:46

2 Answers2

2

I am assuming you are using the command-line client. It has a -configFile option that lets you choose which config file to use. Simply use one config file per DB and you should be OK.

Axel Fontaine
  • 34,542
  • 16
  • 106
  • 137
1

I am assuming you are using the command-line client. It has a -configFile option that lets you choose which config file to use. Simply use one config file per database and you should be ok.

For example, if you have Flyway installed in a folder called c:/Flyway:

  • Copy your conf/flyway.conf file to a file called conf/prod.conf.

  • Open it and update the username, password, and url properties, e.g:

    flyway.url=jdbc:postgresql://dbinstance.eu.rds.amazonaws.com:5432/myapp

  • Then run in a command prompt (shell):

    flyway -configFile=c:/flyway/conf/prod.conf migrate

Richard
  • 14,798
  • 21
  • 70
  • 103