Flyway Spring boot + istniejąca baza

0

Hej. Mam taki problem:
Odziedziczyłem projekt z kiepskim CI/CD
Do tej pory migracje baz danych były wykonywane ręcznie.
Próbuję swoich sił w flyway. Mam już istniejąca bazę danych.

dorzuciłem do gradla:
compile group: 'org.flywaydb', name: 'flyway-core', version: '5.2.4'

do applciation properties:
spring.flyway.enabled = true
spring.flyway.baseline-on-migrate = true

resources/db/migration mam plik V1__TASK_224.sql

Podczas startu widzę w logach:
2019-09-09 1126.080 INFO 22078 --- [ restartedMain] o.f.c.internal.license.VersionPrinter : Flyway Community Edition 5.2.4 by Boxfuse
2019-09-09 1126.085 INFO 22078 --- [ restartedMain] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2019-09-09 1126.266 INFO 22078 --- [ restartedMain] o.f.c.internal.database.DatabaseFactory : Database: jdbc//localhost:3306/compose (MySQL 5.7)
2019-09-09 1126.315 INFO 22078 --- [ restartedMain] o.f.core.internal.command.DbValidate : Successfully validated 1 migration (execution time 00:00.008s)
2019-09-09 1126.326 INFO 22078 --- [ restartedMain] o.f.c.i.s.JdbcTableSchemaHistory : Creating Schema History table: compose.flyway_schema_history

Tworzy tabelę flyway_schema_history, ale nie tworzy mi tego, co jest w pliku.
Czy ktoś próbował zrobić już coś takiego?

0

Co siedzi w historii migracji w wygenerowanej tabeli flyway_schema_history? Twoja migracja to dump starej schemy bazy, którym stawiasz bazę od zera, czy jakieś bieżące zmiany do istniejącej schemy?

0

Hej. Bieżące zmiany do istniejącej schemy.
flyway_chema_history pokazuje tylko
'1', '1', '<< Flyway Baseline >>', 'BASELINE', '<< Flyway Baseline >>', NULL, 'admin', '2019-09-09 1321', '0', '1'

a mojej tabeli z pliku V1__nazwa.sql nie ma

2019-09-09 15:16:19.312  INFO 18941 --- [  restartedMain] o.f.core.internal.command.DbValidate     : Successfully validated 1 migration (execution time 00:00.317s)
Mon Sep 09 15:16:19 CEST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2019-09-09 15:16:19.805  INFO 18941 --- [  restartedMain] o.f.c.i.s.JdbcTableSchemaHistory         : Creating Schema History table: `compose`.`flyway_schema_history`
Mon Sep 09 15:16:19 CEST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Sep 09 15:16:20 CEST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Mon Sep 09 15:16:21 CEST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2019-09-09 15:16:21.519  INFO 18941 --- [  restartedMain] o.f.core.internal.command.DbBaseline     : Successfully baselined schema with version: 1
Mon Sep 09 15:16:21 CEST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2019-09-09 15:16:21.849  INFO 18941 --- [  restartedMain] o.f.core.internal.command.DbMigrate      : Current version of schema `compose`: 1
2019-09-09 15:16:21.900  INFO 18941 --- [  restartedMain] o.f.core.internal.command.DbMigrate      : Schema `compose` is up to date. No migration necessary.
0

Chyba sam już wiem o co chodzi.
Base line zrobiło mi wersję 1, i mój plik ma V1__nazwa.sql, więc musiałby mieć nazwę V1_1__nazwa.sql, albo V2__naswa.sql

1 użytkowników online, w tym zalogowanych: 0, gości: 1