1
votes

I having troubles to set up my new dev environment.

I was working with flyway for an simple web app. The process worked well since now. I have a new work environment and I've used pg_dump and pg_sql to restore the base like the qualification environment to get back with the good set of datas.

even thought my public.schema_version on my local environment is well backed up (with all the line regarding previous migrations) my server won't start and keep saying this :

2017-11-27 15:48:55.476  INFO 12857 --- [           main] o.f.c.i.dbsupport.DbSupportFactory       : Database: jdbc:postgresql://localhost:5432/volt (PostgreSQL 9.4)
2017-11-27 15:48:55.572  INFO 12857 --- [           main] o.f.core.internal.command.DbValidate     : Successfully validated 110 migrations (execution time 00:00.050s)
2017-11-27 15:48:55.584  INFO 12857 --- [           main] o.f.core.internal.command.DbMigrate      : Current version of schema "public": << Empty Schema >>
2017-11-27 15:48:55.587  INFO 12857 --- [           main] o.f.core.internal.command.DbMigrate      : Migrating schema "public" to version 1.2 - Changing object type report
2017-11-27 15:48:55.595 ERROR 12857 --- [           main] o.f.core.internal.command.DbMigrate      : Migration of schema "public" to version 1.2 - Changing object type report failed! Changes successfully rolled back.

Here 1.2 is the first screep that i've created.. And if I'm looking up to my local base I've all my flyway lines with the success column set to true (included the 1.2 one).

Does flyway keep the current version elsewhere than in the table "schema_version" ? How do I tell flyway that my schema version is up to date regarding the migrations ?

PS : I'm using a spring-boot environment with only the flyway-core dependency in my pom.xml and this line in my spring-boot properties file

flyway:
   baseline-on-migrate: true
1

1 Answers

0
votes

I found out that i've used another user existing only in qualification to restore my base.. So my user in my development environment was not on the good schema of my base.

I've re-created my base with the proper user and everything was working again.