Questions tagged [flyway]

Flyway by Boxfuse is an open-source database migration tool. It strongly favors simplicity and convention over configuration.

Flyway by Redgate is an open-source database migration tool. It strongly favors simplicity and convention over configuration.

It runs on Windows, macOS and Linux, Java and Android.

It is based around just 7 basic commands: Migrate, Clean, Info, Validate, Undo, Baseline and Repair.

Migrations can be written in SQL (database-specific syntax (such as PL/SQL, T-SQL, ...) is supported) or Java (for advanced data transformations or dealing with LOBs).

It has a Command-line client. If you are on the JVM, we recommend using the Java API (also works on Android) for migrating the database on application startup. Alternatively, you can also use the Maven plugin or the Gradle plugin.

And if that not enough, there are plugins available for Spring Boot, Dropwizard, Grails, Play, SBT, Ant, Griffon, Grunt, Ninja and more!

Supported databases are Oracle, SQL Server, DB2, MySQL (including Amazon RDS), Aurora MySQL, Percona XtraDB Cluster, MariaDB, PostgreSQL (including Amazon RDS and Heroku), Aurora PostgreSQL, Redshift, CockroachDB, Informix, H2, HSQLDB, Derby, SQLite, SAP HANA and Sybase ASE.

More info:

2221 questions
36
votes
5 answers

Flyway: non-empty schema without metadata table

Found non-empty schema "public" without metadata table! Use init() or set initOnMigrate to true to initialize the metadata table. I'm using Postgres 9.2 with Postgis 2.0. This means that by default when I create a new database there will be a…
markdsievers
  • 7,151
  • 11
  • 51
  • 83
34
votes
2 answers

Flyway and liquibase together?

I've looked at both Liquibase and Flyway individually and on an individual comparison alone, Liquibase seems like the better tool for our needs. Some sources mention using both Liquibase and Flyway together. Liquibase seems to have everything Flyway…
Slayer0248
  • 1,231
  • 3
  • 15
  • 26
34
votes
2 answers

Best way for "database specific" sql scripts with Flyway

I started to use Flyway in my current project for database migrations and I like it very much. I currently use Oracle in PROD- and Derby in TEST-Environment. Pretty soon, I did run in the problem of database specific sql commands, e.g. ALTER TABLE…
Peti
  • 1,670
  • 1
  • 20
  • 25
31
votes
4 answers

Flyway 5.0.7 warning about using schema_version table

We use the Flyway Gradle plugin to do our migrations offline (i.e. we migrate while the system is down). We recently upgraded to Flyway 5.0.7 and we see this warning now for migrations: Could not find schema history table…
Tony C.
  • 323
  • 1
  • 4
  • 8
31
votes
2 answers

flyway exception, detected failed migration

I've got a Flyway exception: FlywayException: Detected failed migration to version 1.0 I looked for on documentation and forums but I didn't found what mean this exception. Please someone can tell me what can be the reasons of these exception…
Gwen
  • 311
  • 1
  • 3
  • 3
31
votes
3 answers

How to use HikariCP in Spring Boot with two datasources in conjunction with Flyway

I want to use HikariCP as JDBC connection pool in my Spring boot application. I have two datasources (MySQL database as the primary database and accessing those data through Hibernate and additionally an Oracle database for reading some other data…
ThomasW
  • 481
  • 1
  • 6
  • 12
31
votes
7 answers

Spring Boot: Hibernate and Flyway boot order

I have created Spring application. Pom xml is attached. It has a config like this (below) and some db/migration/V1__init.sql for Flyway db migration tool. It has hsqldb in-memory database and it is created after application is started. It is clean…
user3636486
  • 409
  • 1
  • 5
  • 11
31
votes
5 answers

Using Flyway to load data conditionally per environment

Does flyway support conditional execution of a script, per environment? For example, if I have test data, can I create a test data script folder thats only loaded if the env is configured as test?
fansonly
  • 1,150
  • 4
  • 14
  • 29
30
votes
4 answers

Spring Boot 2.1.0 with Flyway 4.2.0

I would like to upgrade for my new projects to Spring Boot version 2.1.0, but I am limited with Oracle 11 database, which is supported by the Flyway 4.2.0 library. Everything runs normally on Spring Boot version 2.0.5 Release, but when moving to…
troger19
  • 1,159
  • 2
  • 12
  • 29
29
votes
2 answers

Best practice: How to modify flyway migration script after it has been used

I am looking for an advice in the following case. I set up flyway migration scripts in my production environment. On every deployment the database will be migrated to the current version. I already have created several migrations scripts which have…
jdoose
  • 503
  • 1
  • 6
  • 6
28
votes
5 answers

Multiple datasources migrations using Flyway in a Spring Boot application

We use Flyway for db migration in our Spring Boot based app and now we have a requirement to introduce multi tenancy support while using multiple datasources strategy. As part of that we also need to support migration of multiple data sources. All…
Eli Avzak
  • 283
  • 1
  • 3
  • 5
28
votes
3 answers

Retry a flyway failed migration

I'm just in the process of configuring and fully understanding flyway and I came into this situation: I successfully configured a new project to work with flyway. I successfully migrated a test database from version 0 to 1.0.3. Migration to version…
pablocmg
  • 409
  • 2
  • 5
  • 11
27
votes
3 answers

flyway - The meaning of the concept of checksums

I'm learning Flyway migration tool, and I don't have clear the concept of checksums. Could someone explain me what is? how is it calculated, or how can it be changed? I understand the repair command re-calculate the checksum, I do not understand how…
AleGallagher
  • 1,745
  • 7
  • 30
  • 40
27
votes
3 answers

How to skip a specific migration with flyway?

I'm using flyway with gradle, I've run one of the migrations manually inside the database console, I want to run flyway, but tell it to ignore one specific migration version in between all the others. Can this be done?
Iman
  • 382
  • 1
  • 4
  • 10
26
votes
2 answers

flyway : Unsupported Database: MySQL 8.0

I am using java 11, and I have added flyway in spring-boot application like below. dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' implementation group: 'mysql', name: 'mysql-connector-java', version:…
Sandeep Patel
  • 2,069
  • 2
  • 14
  • 20