title: Manage multiple database with the flyway migrations gradle plugin
body: <p>We have two databases for which we'd like to manage their migrations using flyway's gradle plugin.</p>
  
  <p>I'd like to have a single task that can migrate both databases.  However, I can't seem to get the flywayMigrate task to be called twice from a single task.</p>
  
  <p>Here's what I have...</p>
  
  <pre><code>task migrateFoo() {
      doFirst {
          flyway {
              url = 'jdbc:mysql://localhost/foo'
              user = 'root'
              password = 'password'
              locations = ['filesystem:dev/src/db/foo']
              sqlMigrationPrefix = ""
              initOnMigrate = true
              outOfOrder = true
          }
      }
      doLast {
          tasks.flywayMigrate.execute()
      }
  }
  
  task migrateBar() {
      doFirst {
          flyway {
              url = 'jdbc:mysql://localhost/bar'
              user = 'root'
              password = 'password'
              locations = ['filesystem:dev/src/db/bar']
              sqlMigrationPrefix = ""
              initOnMigrate = true
              outOfOrder = true
          }
      }
      doLast {
          tasks.flywayMigrate.execute()
      }
  }
  
  task migrate(dependsOn: ['migrateFoo','migrateBar']) {}
  </code></pre>
  
  <p>Explicitly calling either migrateFoo or migrateBar from the command line works fine, however, if I try to call the migrate task only database foo is updated.</p>
  
  <p>Both the doFirst and doLast tasks of the migrateBar task are called, however, the tasks.flywayMigrate.execute() task isn't called the second time from migrateBar.</p>
  
  <p>How can I get flyway to migrate both foo and bar from a single task?</p>