Which version and edition of Flyway are you using?
6.0.6 community edition
Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)
Which database are you using (type & version)?
Which operating system are you using?
What did you do?
Attempted to integrate flyway into an existing MySQL database using the gradle flywayMigrate task. The database is hosted on Google Cloud Platform and has binary logs enabled, which forces --enforce-gtid-consistency.
What did you expect to see?
The database should have been updated with the contents of our db.migration scripts.
What did you see instead?
Flyway fails to create the flyway_schema_history table.
SQL State : HY000
Error Code : 1786
Message : Statement violates GTID consistency: CREATE TABLE ... SELECT.
Location : ()
Line : 1
Statement : CREATE TABLE `delivery_confirmation`.`flyway_schema_history` (
`installed_rank` INT NOT NULL,
`description` VARCHAR(200) NOT NULL,
`type` VARCHAR(20) NOT NULL,
`script` VARCHAR(1000) NOT NULL,
`installed_by` VARCHAR(100) NOT NULL,
`installed_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`execution_time` INT NOT NULL,
`success` BOOL NOT NULL,
CONSTRAINT `flyway_schema_history_pk` PRIMARY KEY (`installed_rank`)
) ENGINE=InnoDB AS SELECT 1 as "installed_rank", '1' as "version", '<< Flyway Baseline >>' as "description", 'BASELINE' as "type", '<< Flyway Baseline >>' as "script", NULL as "checksum", 'DELIVERY_CONFIRM' as "installed_by", CURRENT_TIMESTAMP as "installed_on", 0 as "execution_time", TRUE as "success"
Disabling binary logs on the target database allows flyway to correctly migrate the database.
The text was updated successfully, but these errors were encountered: