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
3条答案
按热度按时间7z5jn7bk1#
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.
oyjwcjzk2#
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:
flyway.url=jdbc:postgresql://dbinstance.eu.rds.amazonaws.com:5432/myapp
flyway -configFile=c:/flyway/conf/prod.conf migrate
ohfgkhjo3#
There is actually useful documentation on the topic: https://documentation.red-gate.com/fd/configuration-files-224003079.html
And the configuration property of the CLI is now called
-configFiles
and allows specifying multiple entries.E.g. create a file per database with connection properties like
flyway-local.conf:
And reference it with
./flyway -configFiles=flyway-local.conf migrate