You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MariaDB 10.1.13. Note: this issue is caused by setting innodb_force_primary_key=1 which is required for the Galera cluster to work properly. You dont need to set up a Galera cluster to reproduce this issue, you can do it by setting that property on a normal MariaDB instance.
What operating system are you using?
Mac OSX and Linux
What did you do?
Ran Flyway.migrate() and observed the following error:
2016.04.26 12:09:22.980 INFO [main] o.f.c.i.u.l.slf4j.Slf4jLog.info (Slf4jLog.java:44) - Creating Metadata table: `sentinel_audit`.`schema_version`
2016.04.26 12:09:23.006 WARN [main] o.f.c.i.u.l.slf4j.Slf4jLog.warn (Slf4jLog.java:48) - DB: This table type requires a primary key (SQL State: 42000 - Error Code: 1173)
2016.04.26 12:09:23.009 WARN [main] o.s.c.s.AbstractApplicationContext.refresh (AbstractApplicationContext.java:545) - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayConfig': Injection of autowired dependencies failed; nested exception is org.flywaydb.core.internal.dbsupport.FlywaySqlScriptException:
Script failed
-------------
SQL State : 42000
Error Code : 1173
Message : This table type requires a primary key
Line : 17
Statement : CREATE TABLE `sentinel_audit`.`schema_version` (
`installed_rank` INT NOT NULL,
`version` VARCHAR(50),
`description` VARCHAR(200) NOT NULL,
`type` VARCHAR(20) NOT NULL,
`script` VARCHAR(1000) NOT NULL,
`checksum` INT,
`installed_by` VARCHAR(100) NOT NULL,
`installed_on` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`execution_time` INT NOT NULL,
`success` BOOL NOT NULL
) ENGINE=InnoDB
What did you expect to see?
The schema_version table created successfully
What did you see instead?
A This table type requires a primary key error returned from the database server
What version of Flyway are you using?
4.0
What database are you using (type & version)?
MariaDB 10.1.13. Note: this issue is caused by setting
innodb_force_primary_key=1
which is required for the Galera cluster to work properly. You dont need to set up a Galera cluster to reproduce this issue, you can do it by setting that property on a normal MariaDB instance.What operating system are you using?
Mac OSX and Linux
What did you do?
Ran Flyway.migrate() and observed the following error:
What did you expect to see?
The
schema_version
table created successfullyWhat did you see instead?
A
This table type requires a primary key
error returned from the database serverSince you use DB-specific SQL for each database, the following script can be updated to create a primary key at the same time as the table instead of directly afterwards: https://github.com/flyway/flyway/blob/master/flyway-core/src/main/resources/org/flywaydb/core/internal/dbsupport/mysql/createMetaDataTable.sql
I will submit a pull request for this.
The text was updated successfully, but these errors were encountered: