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

How to debug when Flyway doesn't work on Spring Boot?

I am using Maven and Spring Boot. I run the application using mvn spring-boot:run. https://flywaydb.org/documentation/plugins/springboot says Flyway should be called on Spring Boot start. So my pom.xml contains the dependency to Flyway.…
Adrian Smith
  • 17,236
  • 11
  • 71
  • 93
26
votes
3 answers

Automatic generation of migration SQL for Flyway

Is it possible for new Flyway migrations to be generated by JPA/Hibernate's automatic schema generation when a new model / field etc. are added via Java code. It would be useful to capture the auto-generated SQL and save it directly to a new Flyway…
ocodo
  • 29,401
  • 18
  • 105
  • 117
25
votes
9 answers

Flyway - Cannot find migrations location in

I can't seem to let flyway know where to look for my migrations. My file structure is the default generated from spring initializr. My migrations are in: ./demo/src/main/kotlin/db/migration My migrations are java based My application.properties file…
PaulB
  • 1,554
  • 2
  • 16
  • 34
25
votes
6 answers

Can I use property file in maven pom.xml for flyway configuration

com.googlecode.flyway flyway-maven-plugin 1.7 com.mysql.jdbc.Driver
Garry
  • 678
  • 1
  • 9
  • 21
24
votes
1 answer

Logging Flyway sql with Spring Boot

Is there a way to show Flyway migration steps in the console, while starting a Spring Boot app? Migration is working correctly. I just do not see any log about it. I have checked flyway properties, but there is nothing about it.
hybaken
  • 466
  • 1
  • 5
  • 16
23
votes
1 answer

Flyway db migration folder

I have a question about flyway migration folder . Does sql's have to reside in project folder Application/foo/bar/main/resources/db/migration. Could it reside outside of the application cource folder? We are using Maven.
TechArch
  • 273
  • 1
  • 3
  • 8
23
votes
2 answers

CDI Extension for Flyway

I tried to run flyway in my application before hibernate is hooking in on my JBoss AS 7.1. I tried with an @javax.ejb.Startup annotation, but this gets executed AFTER Hibernate is initialized and the database scheme is checked. So as far as I…
Dominik Obermaier
  • 5,610
  • 4
  • 34
  • 45
22
votes
5 answers

Spring Boot FlywayException: Unable to connect to the database. Configure the url, user and password

When I run maven flyway:migrate, I get the error Failed to execute goal org.flywaydb:flyway-maven-plugin:6.5.5:migrate (default-cli) on project myProject: org.flywaydb.core.api.FlywayException: Unable to connect to the database. Configure the url,…
Jack Cole
  • 1,528
  • 2
  • 19
  • 41
22
votes
5 answers

How to manage schema migrations in Google BigQuery

How to manage schema migrations for Google BigQuery, we have used Liquibase and Flyway in the past. What kind of tools can we use to manage schema modifications and the like (e.g. adding a new column) across dev/staging environments.
22
votes
7 answers

Setting Flyway 'baselineOnMigrate' and 'baselineVersion' using spring boot property file

Spring Boot's FlywayProperties.java supports many of the Flyway settings but not 'baselineVersion' or 'baselineOnMigrate'. I am converting an existing application to Flyway and these setting appear to be designed for this purpose. Our production…
dropofahat
  • 283
  • 1
  • 2
  • 12
21
votes
2 answers

How to control execution order of flyway repeatable scripts

Is there any way to control execution order of repeatable migration scripts in flyway? I want to run a repeatable migration script after all other repeatable or versioned scripts on checksum change.
Seyyed Jamal
  • 394
  • 1
  • 2
  • 9
21
votes
4 answers

How to run flyway:clean before migrations in a SpringBoot app?

I am using Springboot and Flyway. The migrations work just fine but I wanted to be able perform a clean flyway command when the application context gets loaded with test profile. Is it possible to configure SpringBoot to do clean and then migrate if…
Barbadoss
  • 1,136
  • 3
  • 14
  • 22
20
votes
7 answers

Flyway: Cannot find migrations location in: [classpath:db/migration]

I created an new project with springboot2.2.0.M2 / Flyway 5.2.4 / Java8. After try to start my project i got : . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)|…
William He
  • 351
  • 1
  • 3
  • 8
20
votes
3 answers

How to start flyway after database initialization in Docker

I have following docker compose file(docker-compose-dev.yml): version: '3' services: my_sql_db: image: percona:latest container_name: my_sql_db environment: MYSQL_ROOT_PASSWORD: password MYSQL_DATABASE: abhs ports: …
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
19
votes
2 answers

How to squash/merge migrations in flyway

Let's say I have migrations script from V1_1 to V1_300 - it is quite a huge number and takes very long period of time. But from time to time there is a release - can I, from the point of flyway, somehow merge all those migrations so: All migrations…
Mateusz Chrzaszcz
  • 1,240
  • 14
  • 32