Rohit Gupta
Rohit Gupta

Reputation: 63

Upgrade flyway version 1.5 to 3.2

I have been looking for migration method from flyway version 1.x to 3.x (i.e. com.googlecode.flyway to org.flywaydb) everywhere it is mentioned to migrate first to version 2.3 but no where it is mentioned how? Is there a direct way to do it or do I have to do something from backend.

My database already has data and I cannot drop database. Note: Flyway 1.X to 2.X has breaking changes for table schema_version.

EDIT

I have upgraded my maven dependency for flyway from 1.5 to 3.1. It now says schema_version does not have some column which is made by flyway itself for its own reference. I went through docs and all over stackoverflow and found flyway 3.1 and 1.5 are incompatible. It is mentioned on SO and docs that we need to first upgrade to 2.3 and then to 3.1. But no where it is mentioned how. Because just by adding pom dependency, it doesnot seem to solve the schema_version problem.

I also tried adding 2.3 to pom and started my spring based application but still Flyway fails throwing stacktrace saying it cannot find some column.

Exact error is Unknown column 'success' in 'where clause' for schema_version table made by flyway 1.5 itself.

Please suggest how to fix this up ?

Upvotes: 0

Views: 559

Answers (1)

dur
dur

Reputation: 16979

As you can see at Release Notes:

  • Dropped compatibility with the Flyway 1.X metadata table format. If you are upgrading from 1.X, you must upgrade to 2.3 first, before upgrading to 3.0.

you have to upgrade to version 2.3. And as you could read in Release Notes:

Flyway 2.1 (2013-03-05)

This version fixes minor issues with the metadata table. Migration is transparent and automatic on first run.
[...]

Flyway 2.0.2 (2012-11-22)

This version performs minor fixes on the metadata table. Migration is transparent and automatic on first run.
[...]

Flyway 2.0 (2012-11-14)

This version comes with a new metadata table format. Migration is transparent and automatic on first run.

Flyway upgrades its schema by itself.

See also:

Upvotes: 1

Related Questions