Does it exist? Could it be that you deleted it again, as well as cohort, when you ran into the latest “cohort already exists” error? Flyway keeps track of migrations applied, and if you deleted cohort_definition after it had applied the “create cohort_definition” script, then that would explain the error.
You might consider creating a new schema for WebAPI and separate that schema from the “CDM schema”. There is a known conflict between naming conventions between WebAPI and CDM with regards to cohort and cohort_definition.
The scripts are here in case you haven’t referenced them:
2015-09-02 01:03:55.484 INFO qtp965307475-44 org.flywaydb.core.internal.command.DbMigrate - - Current version of schema "public": 1.0.0.3.2
2015-09-02 01:03:55.484 WARN qtp965307475-44 org.flywaydb.core.internal.command.DbMigrate - - outOfOrder mode is active. Migration of schema "public" may not be reproducible.
2015-09-02 01:03:55.485 INFO qtp965307475-44 org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "public" to version 1.0.0.4
2015-09-02 01:03:55.592 INFO qtp965307475-44 org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "public" to version 1.0.0.4.1
2015-09-02 01:03:55.594 INFO qtp965307475-44 org.flywaydb.core.internal.dbsupport.JdbcTemplate - - DB: table "heracles_heel_results" does not exist, skipping
2015-09-02 01:03:55.607 INFO qtp965307475-44 org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "public" to version 1.0.0.4.3
2015-09-02 01:03:55.628 INFO qtp965307475-44 org.flywaydb.core.internal.command.DbMigrate - - Migrating schema "public" to version 1.0.0.5
2015-09-02 01:03:55.638 ERROR qtp965307475-44 org.flywaydb.core.internal.command.DbMigrate - - Migration of schema "public" to version 1.0.0.5 failed! Changes successfully rolled back.