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

Erro na migration

Eu ja tinha uma migration V3 para criação de tabelas de pacientes em um desafio. Mas ao fazer a alteração da tabela ao adicionar coluna de ativos ocorre isto. Está sendo exibido o seguinte erro:

Migration checksum mismatch for migration version 4 -> Applied to database : 0 -> Resolved locally : 1968273893 Either revert the changes to the migration, or run repair to update the schema history. Need more flexibility with validation rules? Learn more: https://rd.gt/3AbJUZE 2024-08-07T18:43:57.422-03:00 INFO 15432 --- [api] [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated... 2024-08-07T18:43:57.450-03:00 INFO 15432 --- [api] [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed. 2024-08-07T18:43:57.452-03:00 INFO 15432 --- [api] [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat] 2024-08-07T18:43:57.464-03:00 INFO 15432 --- [api] [ restartedMain] .s.b.a.l.ConditionEvaluationReportLogger :

Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2024-08-07T18:43:57.489-03:00 ERROR 15432 --- [api] [ restartedMain] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Failed to initialize dependency 'flywayInitializer' of LoadTimeWeaverAware bean 'entityManagerFactory': 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 4 -> Applied to database : 0 -> Resolved locally : 1968273893 Either revert the changes to the migration, or run repair to update the schema history. Need more flexibility with validation rules? Learn more: https://rd.gt/3AbJUZE at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:326) ~[spring-beans-6.1.11.jar:6.1.11] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:205) ~[spring-beans-6.1.11.jar:6.1.11] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:954) ~[spring-context-6.1.11.jar:6.1.11] at

1 resposta
solução!

Oi!

Você alterou o código de uma migration que já havia sido executada no banco de dados, algo que não é permitido. Veja aqui para resolver: https://cursos.alura.com.br/course/spring-boot-3-desenvolva-api-rest-java/task/121056