AxoKoi / BandurriaJ

BandurriaJ is a java disc-catalogue manager and tagger.
GNU General Public License v3.0
2 stars 0 forks source link

DB Migration not supported from 0.0.1 to 0.0.2 #69

Closed tmagis closed 3 years ago

tmagis commented 3 years ago

The database schema seems to have evolved, but the DB migration is not supported between these two versions.

Stacktrace:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-04-15 02:00:07,821 ERROR org.springframework.boot.SpringApplication [JavaFX-Launcher] Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocation of init method failed; nested exception is org.flywaydb.core.api.FlywayException: Validate failed: Detected failed migration to version 1.0.0 (init)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1794)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:311)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
    at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
    at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)
    at com.axokoi.bandurriaj.MainApplication.init(MainApplication.java:36)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:824)
    at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:195)
    at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.flywaydb.core.api.FlywayException: Validate failed: Detected failed migration to version 1.0.0 (init)
    at org.flywaydb.core.Flyway.doValidate(Flyway.java:1467)
    at org.flywaydb.core.Flyway.access$100(Flyway.java:82)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:1349)
    at org.flywaydb.core.Flyway$1.execute(Flyway.java:1341)
    at org.flywaydb.core.Flyway.execute(Flyway.java:1696)
    at org.flywaydb.core.Flyway.migrate(Flyway.java:1341)
    at org.springframework.boot.autoconfigure.flyway.FlywayMigrationInitializer.afterPropertiesSet(FlywayMigrationInitializer.java:65)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790)
    ... 20 common frames omitted
IgnacioRondini commented 3 years ago

Hello Yes indeed, as these are still alpha releases, migration of db schema are not still supported. Nevertheless, we've implemented flyway to handle this. For next release, we will see depending on the changes if we already test a db migration or not. In any case, the mechanism will have to be tested before the first release 1.0.0