Is it possible to specify different sql locations for different environments in the config?

Is it possible to specify different sql locations for different environments in the config? If not, what is the recommended way of using flyway with multiple different projects on the same machine?
Tagged:

Answers

  • Are you able to describe the types of scripts that need to be run only against specific environments?
    David Atkinson
    Product Manager
    Redgate Software
  • charonmecharonme Posts: 3 New member
    yes, each project has its own set of migrations that only apply to the environments related to that project
  • This is something that has come up before so it's on the backlog for consideration.

    Which edition of Flyway are you using? If you're on Teams or Enterprise there is the shouldExecute parameter which allows you to set a deployment rule (expression) for each migration script.
    David Atkinson
    Product Manager
    Redgate Software
  • charonmecharonme Posts: 3 New member
    edited April 9, 2024 12:02PM
    I'm using flyway commandline 10.11.0

    the different projects have their own repositories with their own sets of migrations in their own directories. Right now my workaround is to have separate config files for the separate projects and migrating them by calling
    flyway -configFiles=conf/proj1.toml -environment=local migrate
    from within the flyway directory (the drawbacks are that instead of being able to call flyway form anywhere I now have to be in the flyway directory to be able to reference the config file specific for each project and I have to write out an additional commandline parameter)


Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file