Solucionado (ver solução)
Solucionado
(ver solução)
1
resposta

[Dúvida] Erro de migration persiste.

  • Ja executei o mysql> delete from flyway_schema_history where success = 0; Query OK, 0 rows affected (0,00 sec) mas o erro persiste.
2023-06-11T18:24:06.852-03:00  WARN 80141 --- [  restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Validate failed: Migrations have failed validation
Migration checksum mismatch for migration version 2
-> Applied to database : -1900561884
-> Resolved locally    : 334503446
Either revert the changes to the migration, or run repair to update the schema history.       
...

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2023-06-11T18:24:06.880-03:00 ERROR 80141 --- [  restartedMain] o.s.boot.SpringApplication               : 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]: Validate failed: Migrations have failed validation
Migration checksum mismatch for migration version 2
-> Applied to database : -1900561884
-> Resolved locally    : 334503446
Either revert the changes to the migration, or run repair to update the schema history.
1 resposta
solução!

Tive que ir no mysql workbench , abrir a tabela flyway_schema_history e excluir manualmente a migration que tava dando erro , depois consegui criar outra , sem problemas.

mysql -u root -p
SHOW DATABASES;
use vollmed_api;
show tables;
SELECT * from flyway_schema_history;

//visualizar as alterações e excluir as indesejadas.