I'm not understanding how environments.XXX sections can be used. Do you need to havea a separate section for each sub section? i.e.
[environments.dev]
url = “….”
 

[environments.dev.flyway]
cleanDisabled=false
location = […]

[environments.dev.flyway.placeholders]
environment="DEV"
other_parameter="AnotherParameter"


or can you put them all under [environments.dev] with longer keys?
[environments.dev]
url
flyway.cleanDisabled = false
flyway.placeholders.environment="DEV"


etc.
 

Benjamin Peikes
0

Comments

1 comment

  • Peter Laws
    Official comment

    Yes you have the right idea, the environments are separate from the global flyway scope allowing you to define them granularly and then plug those environments in to alter command targets.

    If XML is more familiar to you than TOML, think of them as nodes with values.

     

    Example TOML

    [flyway]
    email = ""
    token = ""
    locations = ["filesystem:./migrations", "classpath:./jars"]
    callbackLocations = ["filesystem:./migrations"]
    table = "flyway_schema_history"
    errorOverrides = ["S0001:0:I-"]
    ignoreMigrationPatterns = ["*:pending"]
    
    
    [environments.default]
    url = "jdbc:sqlserver://localhost:1433"
    user = "sa"
    password = "*****"
    
    [environments.UAT]
    url = "jdbc:sqlserver://localhost:1434;integratedSecurity=true"
    
    [environments.H2]
    url = "jdbc:h2:./quickTest"
    displayName = "H2"

    Then with my migrate command I can set -environment = default, UAT etc

    Peter Laws

Add comment

Please sign in to leave a comment.