Closed KeruruBruce closed 3 years ago
btw, I remove and recreate the default database lavagna
every time to not cause the duplicate issue.
hi @KeruruBruce
well, the message "Migration of schema lavagna to version 1 - INITIAL VERSION failed! Please restore backups and roll back database and code!" mean something has gone wrong during the first install of the database on mysql. Maybe there is an incompatibility in the sql script with your specific mysql version.
Is it possible to skip the migration by executing stand-alone sql script? Or is there other way to fix it possibly.
yes, you can define the following property: datasource.disable.migration=true , then you must execute the following scripts: https://github.com/digitalfondue/lavagna/tree/master/src/main/resources/io/lavagna/db/MYSQL from V1 .. to V25 but it's not something that I would advise to do.
Instead it would be better to debug the issue in why the sql migration is failing.
Hi @syjer,
Thank you. I have tried different mysql version. The migration works now with mysql 8.0.
Hi, I have tried using mem db HSQLDB and it works well. However, when i switch it to mySQL (mySQL 5.7), the application shows a few exceptions when launched. The application can access mySQL because some tables and functions with the LA prefix are generated in the default database
lavagna
after the execution; however, it seems to fail at certain point. In the end, the web page only shows HTTP ERROR 503 Service Unavailable.The exceptions would be like the following:
[main] ERROR org.flywaydb.core.internal.util.jdbc.TransactionTemplate - Unable to rollback transaction java.sql.SQLException: Connection is closed
[main] ERROR org.flywaydb.core.internal.util.jdbc.TransactionTemplate - Unable to restore autocommit to original value for connection java.sql.SQLException: Connection is closed
[main] ERROR org.flywaydb.core.internal.command.DbMigrate - Migration of schema
lavagna
to version 1 - INITIAL VERSION failed! Please restore backups and roll back database and code![main] ERROR org.flywaydb.core.internal.dbsupport.mysql.MySQLNamedLockTemplate - Unable to release MySQL named lock: Flyway--1719716498 java.sql.SQLException: Connection is closed
[main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'migrator' defined in io.lavagna.config.DataSourceConfig: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.lavagna.service.DatabaseMigrator]: Factory method 'migrator' threw exception; nested exception is org.flywaydb.core.internal.dbsupport.FlywaySqlException: Error restoring current schema to its original setting
Is it possible to skip the migration by executing stand-alone sql script? Or is there other way to fix it possibly.
Thank you.