lpic
lpic

Reputation: 560

flywaydb baseline script doesnt run

i am confused why my baseline script is not being run.

i followed this instructions existing db baseline

when i run the following clean, baseline, migrate the baseline script doesnt get run. i am expecting the V1__BaseLine.sql to be from but from the log it doesnt get run.

the schema reports

1   1   1   BaseLine    BASELINE    BaseLine        OEOWN   11/AUG/15 11:25:56.881000000 AM 0   1
2   2   1.3 create  SQL V1_3__create.sql    1454099419  OEOWN   11/AUG/15 11:25:56.985000000 AM 3   0


scripts
----------
V1__BaseLine.sql
V1_3__create.sql
V1_4__create_other.sql

maven log

 --- flyway-maven-plugin:3.2.1:clean (default-cli) @ SmartFormsService ---
[INFO] Flyway 3.2.1 by Boxfuse
[INFO] Database: jdbc:oracle:thin:@localhost:1521:xe (Oracle 11.2)
[INFO] Cleaned schema "OEOWN" (execution time 00:00.073s)
[INFO] 
[INFO] --- flyway-maven-plugin:3.2.1:baseline (default-cli) @ SmartFormsService ---
[INFO] Database: jdbc:oracle:thin:@localhost:1521:xe (Oracle 11.2)
[INFO] Creating Metadata table: "OEOWN"."schema_version"
[INFO] Schema baselined with version: 1
[INFO] 
[INFO] --- flyway-maven-plugin:3.2.1:migrate (default-cli) @ SmartFormsService ---
[INFO] Database: jdbc:oracle:thin:@localhost:1521:xe (Oracle 11.2)
[INFO] Validated 3 migrations (execution time 00:00.000s)
[INFO] Current version of schema "OEOWN": 1
[INFO] Migrating schema "OEOWN" to version 1.3 - create
[ERROR] Migration of schema "OEOWN" to version 1.3 failed! Please restore backups and roll back database and code!

any help?

-lp

Upvotes: 1

Views: 3685

Answers (1)

Axel Fontaine
Axel Fontaine

Reputation: 35169

Flyway baseline is meant to be run against the DBs where you do NOT want to run the V1 baseline script (the DBs that should not be recreated from scratch)

The V1 baseline script is only meant for new or cleaned DB instances, where Flyway baseline as NOT been run.

What you did is running both Flyway baseline and attempting to run the V1 baseline script, which can never work.

To simplify:

  • DEV: Clean the DB and run the V1 baseline script
  • PROD: Do NOT clean the DB and run flyway baseline

Upvotes: 2

Related Questions