We use the Flyway Gradle plugin to do our migrations offline (i.e. we migrate while the system is down). We recently upgraded to Flyway 5.0.7 and we see this warning now fo
It is possible to migrate from schema_version to flyway_schema_history by mapping a table over the other and copying the relevant records:
DROP TABLE IF EXISTS `flyway_schema_history`;
SET character_set_client = utf8mb4 ;
CREATE TABLE `flyway_schema_history` (
`installed_rank` int(11) NOT NULL,
`version` varchar(50) DEFAULT NULL,
`description` varchar(200) NOT NULL,
`type` varchar(20) NOT NULL,
`script` varchar(1000) NOT NULL,
`checksum` int(11) DEFAULT NULL,
`installed_by` varchar(100) NOT NULL,
`installed_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`execution_time` int(11) NOT NULL,
`success` tinyint(1) NOT NULL,
PRIMARY KEY (`installed_rank`),
KEY `flyway_schema_history_s_idx` (`success`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
insert into flyway_schema_history (installed_rank, version, description, type, script, checksum, installed_by, installed_on, execution_time, success)
select installed_rank, version, description, type, script, checksum, installed_by, installed_on, execution_time, success
from schema_version;
This is the schema version of flyway_schema_history as of flyway 5.2.2. I recommend, to use this script safely, to migrate before to this version and then move forward.
Please, understand that this script must be executed as it is in your db console. This script is for MySQL only. You have to craft your own for other databases.