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
110
votes
25 answers

Caused by: org.flywaydb.core.api.FlywayException: Validate failed. Migration Checksum mismatch for migration 2

I tried to find the solution for the below problem, but none of them worked for me. I am developing Angular + Spring Boot application using MySQL + flyway. Please guide whats going wrong here. org.springframework.beans.factory.BeanCreationException:…
user5707585
84
votes
5 answers

How to disable flyway in a particular Spring profile?

Now I have a spring-boot app which uses MsSQL server. And we use flyway for migrations. I want to add an additional profile for tests. I want to generate tables from entity classes instead of using flyway. I tried smth to write like this in…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
80
votes
8 answers

Detected resolved migration not applied to database on flyway

We are using flyway to manage database schema version and we are facing a problem. Since we work as a team and use git as our source code management, there would be some cases that different people update database schema on their own local repo. If…
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
65
votes
3 answers

How to roll back migrations using Flyway?

MyBatis migrations splits each SQL file into two sections: One for migrating forward one version One for migrating back one version How does one roll back versions using Flyway?
Gili
  • 86,244
  • 97
  • 390
  • 689
65
votes
10 answers

Flyway 3.0 Migration Checksum mismatch

after upgrading Flyway Maven plugin from 2.3 to 3.0 I get: [ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:3.0:migrate (default-cli) on project xxx: org.flywaydb.core.api.FlywayException: Validate failed. Found differences…
bbcooper
  • 1,082
  • 2
  • 10
  • 17
57
votes
3 answers

Java code changeset in liquibase

Is there a way in liquibase to create java code change set (i.e. provide a java class, which will receive a JDBC connection and will perform some changes in the database) ? (I know that flyway has such feature)
Pavel Bernshtam
  • 4,232
  • 8
  • 38
  • 62
52
votes
1 answer

What is Flyway baseline feature good for?

Despite reading all available docs on Flyway website, I still don't understand what is baseline good for. Could somebody explain it in plain English and mention some use cases for this command?
Matt Warrick
  • 1,385
  • 1
  • 13
  • 22
46
votes
5 answers

Flyway: Found non-empty schema(s) "public" without schema history table! Use baseline() - on Empty database

I am trying to configure flyway with kotlin Spring boot, jpa and postgreSQL. My gradle dependencies are: dependencies { implementation('org.springframework.boot:spring-boot-starter-data-jpa') …
PaulB
  • 1,554
  • 2
  • 16
  • 34
46
votes
6 answers

Flyway repair with Spring Boot

I don't quite understand what I am supposed to do when a migration fails using Flyway in a Spring Boot project. I activated Flyway by simply adding the Flyway dependency in my pom.xml. And everything works fine. My database scripts are migrated when…
Jean-François Beauchef
  • 1,291
  • 2
  • 11
  • 21
45
votes
4 answers

Any way to "compress" Flyway migrations?

We are using Flyway to migrate the database schema and we already have more than 100 migration scripts. Once we "squashed" multiple migrations into a single first-version migration, this is ok during development, as we drop and recreate the schema.…
Thiago Negri
  • 5,221
  • 2
  • 28
  • 39
43
votes
3 answers

How to use Flyway when working with feature branches

We have recently moved to using feature branches for each story we work on. These are as independent as possible, and our project manager then decides which stories will make up a release. This means that we do not know the exact order in which…
pledge
  • 1,054
  • 3
  • 12
  • 17
42
votes
5 answers

Embedded Postgres for Spring Boot Tests

I'm building a Spring Boot app, backed by Postgres, using Flyway for database migrations. I've been bumping up against issues where I cannot produce a migration that generates the desired outcome in both Postgres, and the embedded unit test database…
SingleShot
  • 18,821
  • 13
  • 71
  • 101
42
votes
6 answers

How to create a database with flyway?

Question: Is it possible to create a new DB in a migration script and then connect to it? How? My Scenario: I'm trying to use flyway in my Java project (RESTful application using Jersey2.4 + tomcat 7 + PostgreSQL 9.3.1 + EclipseLink) for managing…
sajjadG
  • 2,546
  • 2
  • 30
  • 35
41
votes
1 answer

Liquibase or Flyway database migration alternative for Elasticsearch

I am pretty new to ES. I have been trying to search for a db migration tool for long and I could not find one. I am wondering if anyone could help to point me to the right direction. I would be using Elasticsearch as a primary datastore in my…
Istvano
  • 992
  • 1
  • 12
  • 19
36
votes
2 answers

Flyway and Spring Boot integration

I trying to integrate Flyway for migrations in a Spring Boot project with Hibernate and Spring JPA. I'm getting the following Exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flyway' defined in class…
imalik8088
  • 1,501
  • 5
  • 21
  • 39
1
2 3
99 100