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
12
votes
3 answers

Flyway migration blocked by null version_rank

I'm using PostgreSQL 9.5 and flyway 5.0.7 Everything worked fine for the previous 6 migrations but now it blocks for the latest I have the following error : 22:27:45.230 [INFO ] o.f.c.i.u.l.slf4j.Slf4jLog - Flyway Community Edition 5.0.7 by…
Manu
  • 493
  • 6
  • 17
12
votes
5 answers

Flyway Spring Boot Autowired Beans with JPA Dependency

I am using Flyway 5.0.5 and I am unable to create a java (SpringJdbcMigration) with autowired properties... They end up null. The closest thing I can find is this question: Spring beans are not injected in flyway java based migration The answer…
refeniz
  • 525
  • 1
  • 5
  • 14
12
votes
5 answers

Is there any C# API for Flyway?

Is there any C# API for Flyway? I want to include Flyway with a .Net application and not force none Java developers to install Flyway or Maven or Java. Rather have them use tools they are familiar with like Nuget for example.
Melissa
  • 812
  • 2
  • 10
  • 24
12
votes
3 answers

Why is flyway ignoring my SQL migration files?

We are using flyway in our java, gradle spring based MVC application. I have kept my SQL files at src/main/resources/db/migration folder. Below is my flyway gradle config file. apply plugin: "org.flywaydb.flyway" flyway { driver =…
ajm
  • 12,863
  • 58
  • 163
  • 234
12
votes
4 answers

What is the correct syntax for a Flyway connection string to SQL Server?

Running SQL Server 2012 Express on a remote machine, trying to get Flyway up and running. I have a database on pcesqldev.pce.local called Hawk (dbo.Hawk, if that matters) that I want to connect to, and the template from the config file looks like…
DaveN59
  • 3,638
  • 8
  • 39
  • 51
11
votes
3 answers

Pre- and Post-migration scripts for Flyway

I am looking for a way to execute a hook script before and after migration. I have a bunch of views and stored procedures and would like the process to be: Drop all views and stored procedures. Run the migration. Rebuild views and stored…
Eli
  • 111
  • 1
  • 1
  • 3
11
votes
1 answer

Flyway Core with Spring Boot gives error Circular depends-on relationship between 'delayedFlywayInitializer' and 'entityManagerFactory'

I want to import some data on the SQL server database, I'm using Spring Boot 2.3.4. I use also Hibernate to generate the tables. I added flyway core in pom: org.flywaydb
xarqt
  • 137
  • 1
  • 2
  • 12
11
votes
6 answers

How to upgrade from flyway 3 directly to flyway 5

Working on a product that is deployed by many clients in many production environments. It includes at least one Spring Boot app. We've used flyway for db schema migrations. Upgrading from Spring Boot 1.5.x to 2.0.x has bumped our flyway version…
Dylan Roberts
  • 123
  • 1
  • 5
11
votes
3 answers

Disable Flyway on Spring Boot 2

I've been trying to disable Flyway for my unit tests on Spring Boot 2, but could not succeed. I understand, from Spring Boot's documentation, that the property for doing so changed from flyway.enabled to spring.flyway.enabled, and added that to my…
renke
  • 1,180
  • 2
  • 12
  • 27
11
votes
2 answers

How to generate SQL schema from Spring Boot entities?

Spring Boot is a good framework to develop quickly applications. However, when creating an application binded to database, it seems some of the work must be done twice (I'm using Flyway): create table creation SQL queries scripts create Spring…
frinux
  • 2,052
  • 6
  • 26
  • 47
11
votes
2 answers

Flyway database migration to run automatically when new war deployed

I would like Flyway to run whenever I deploy a new war to my server. Does flyway automatically get run when a server is deployed? Do I have to always automate a script which would then the flyway migration command? Or what is the best way to do…
tt_Gantz
  • 2,786
  • 3
  • 23
  • 43
11
votes
1 answer

Setting up and using flyway on mac

How exactly do you use flyway on Mac, because i'm having trouble! I've installed home brew, download flyway, and unzipped it. I have also set up the flyway.conf to use my DB url, username, and password but it only works within the conf folder. I get…
Bitcode23
  • 111
  • 1
  • 5
11
votes
2 answers

How to fix "Unable to instantiate JDBC driver" Flyway command line error?

I'm new to Flyway. I'm using Flyway 3.2.1 on windows 64bit and just tried the command line tool with my local Oracle database installation (11g). I'm getting the following error: ERROR: Unable to instantiate JDBC driver:…
Matze
  • 191
  • 1
  • 5
11
votes
4 answers

Flyway diff tool

I found this comparing databases and genrating sql script using liquibase and I was wondering if how I can do the same with Flyway. 1.- Generating sql script from the differences between tow databases. Thanks!
chemipot
  • 252
  • 2
  • 7
11
votes
7 answers

How to ignore placeholder expressions for Flyway?

I am using flyway version 2.3, I have an sql patch which inserts a varchar into a table having character sequence that Flyway treats as placeholders. I want to flyway to ignore placeholders and run the script as is. The script file is insert into…
user3356319
  • 113
  • 1
  • 4