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
11
votes
1 answer

How can I log SQL statements executed by Flyway?

Does anyone know how I can log the sql output from Flyway? It logs sql errors only, but I need to log information such as "table created", "table dropped" etc...
tosi
  • 1,873
  • 2
  • 18
  • 38
11
votes
1 answer

schema_version doesn't have select permission?

I executed flyway:init with test/test as user/password and got the following output: [INFO] Creating schema "MY_SCHEMA" ... [INFO] Creating Metadata table: "MY_SCHEMA"."schema_version" [INFO] Schema initialized with version: 1 Then I connected to…
lehphyro
  • 201
  • 3
  • 9
11
votes
2 answers

Flyway Unable to instantiate jdbc driver

Just starting out with Flyway and Spring 3.0. So far, all I did was add the Flyway dependency and plugin to my pom.xml. Next, I tried running mvn flyway:status in the command line. However, it complains that it is unable to instantiate the jdbc…
OckhamsRazor
  • 4,824
  • 13
  • 51
  • 88
11
votes
2 answers

production data migration patterns in continuous delivery

What are relational database (and schema) migration patterns on production in continuous delivery? In many traditional developments the DBA arranges a big migration script out of the many smaller scripts created in the current release cycle. But in…
Yaron Naveh
  • 23,560
  • 32
  • 103
  • 158
10
votes
13 answers

Spring Boot Application is not running Flyway migrations on startup

I have a Spring Boot Application with a couple Entity classes and I'm trying to implement database migrations with flyway. It appears that, on startup, Spring Boot is not running flyway at all. Here is my…
10
votes
4 answers

Validate failed: Detected applied migration not resolved locally | Flyway

While setting up flyway i am getting this error in my spring-boot app org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource…
Harsh
  • 193
  • 1
  • 2
  • 8
10
votes
3 answers

How to initialize postgres db with flyway in docker?

I have django app that I am attempting to host in docker. I have been unsuccessful in launching my postgres server before standing up the django app. Here is my docker-compose.yaml version: '3' services: flyway: image: boxfuse/flyway …
dweeb
  • 539
  • 2
  • 6
  • 21
10
votes
4 answers

FlyWayDB - Unable to resolve location classpath

i have problem to setting location with the classpath in FLyway, when I use with the filesystem its working properly. Example: This…
newOne
  • 679
  • 2
  • 9
  • 27
10
votes
2 answers

Flyway on production database - Migration Checksum mismatch

Every time I change something from DB structure I create a new migration file using timestamp to execute in order, with a clean database the migrate command (with maven plugin or command-line tool) it works perfectly, but in a production database,…
Claudinei
  • 305
  • 1
  • 6
  • 17
10
votes
2 answers

H2 and Oracle Compatiability issues

I am having an issue executing the following script using Flyway and H2 database. I assume its a Oracle compatibility issue but I am using H2 with the correct mode. This script is used to construct my tables in production but I want to use an…
john
  • 709
  • 3
  • 13
  • 25
10
votes
6 answers

Flyway not finding my sql migrations in db/migration

The error: [ERROR] com.googlecode.flyway.core.api.FlywayException: Unable to determine URL for classpath location: db/migration (ClassLoader: ClassRealm[plugin>com.googlecode.flyway:flyway-maven-plugin:2.1.1, parent:…
Jeff D
  • 2,164
  • 2
  • 24
  • 39
10
votes
6 answers

Schema related problems with Flyway / Spring and H2 embedded database

I am building a Spring 3 MVC app that uses a MySQL database and have recently integrated Flyway into the solution to manage the database migrations. I have successfully configured my applicationContext.xml according to the Flyway documentation such…
stevenghines
  • 1,809
  • 2
  • 14
  • 15
9
votes
1 answer

Springboot 2.5.1 service doesn't stop on System.exit(0)

We have a spring-boot service, that needs to stop after it did some DB migration with flyway. We solved that via a callback and the lines int exitCode = SpringApplication.exit(applicationContext, () -> 0); System.exit(exitCode); It worked fine so…
hecko84
  • 1,224
  • 1
  • 16
  • 29
9
votes
2 answers

Flyway, Postgresql, Unable to acquire Flyway advisory lock

We had a transaction that updates 2000000 rows in a postgresql 10 database using flyway (v6). It failed with Unable to acquire Flyway advisory lock . 2000000 records is not that big and it is 1 logical transaction. I was able to reproduce the…
Stéphane
  • 99
  • 1
  • 4
9
votes
6 answers

Database migrations with R2DBC

I am new to R2DBC (https://r2dbc.io/). I would like to know whether r2dbc's ecosystem has a database migration tool/framework. It seems Liquibase & Flyway depend on JDBC. Is there a plan for allowing those frameworks to support a r2dbc driver? Any…
balteo
  • 23,602
  • 63
  • 219
  • 412