Redgate Flyway

Tutorial - Create a new database per branch


  1. In Flyway Desktop, in the settings cog in the upper right , edit your development database connection details
  2. Enter a database name which uses the Git resolver to incorporate the branch name into the database name e.g. TalkrDev_${git.branch:ad}.

If you have a main branch and a branch called feature, you would need to create two databases, TalkrDev_main and TalkrDev_feature .

Edit your development environment in your toml config file or user config file, and use the git resolver to generate the database name based on the branch name. For SQL Server this will look something like this:

  1. [environments.development]
  2. url = "jdbc:sqlserver://localhost:1433;database=TalkrDev_${git.branch:ad};authentication=sqlPassword;trustServerCertificate=true;"
  3. user = "sa"
  4. password = "TalkrPass123"

If you have a main branch and a branch called feature, you would need to create two databases, TalkrDev_main and TalkrDev_feature .

Next steps


Didn't find what you were looking for?