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

Flyway migrations - fail at app start, but works when triggered from intellij

I have a Spring Boot project with ~500 flyway migration files that are ran against oracle sql database (19c). When inside Intellij Idea, I'm able to run migration scripts successfully with mvn flyway:migrate. However when doing the same at…
brtk
  • 65
  • 1
  • 6
0
votes
1 answer

Liquibase update when pod goes down

I am deploying liquibase scripts using CI CD pipeline. There are some instances where a liquibase changeset transaction might take very long and the pod may go down during that time. For example, a changeset adds a new non-null column into an…
San N
  • 13
  • 1
  • 5
0
votes
0 answers

Flyway Undo function not working for jenkins pipeline

I am using Flyway Enterprise Edition (unlimited schemas) 6.1.0. I am trying to undo flyway migration to a certain version. Created a config file and provided target flyway.target=90000. I am using mvn command to run the migration as shown…
MCVSHarry
  • 1
  • 1
0
votes
0 answers

Importing from csv to Postgres

I want to import data from a .csv file to my Postgres DB via flyway migration (Spring Boot, Java). I have a Flyway migration file like: COPY some_schema.some_table (column1, column2, column3) FROM 'C:\some-absolute-path\someFile.csv' DELIMITER…
Aceccop
  • 126
  • 6
0
votes
1 answer

Flyway connection failing, connecting using psql command line works fine

I have a docker service for postgres that is running fine: postgres: restart: always image: postgres:13.0-alpine ports: - "5432:5432" environment: - DEBUG=false - POSTGRES_DB=yola -…
Blankman
  • 259,732
  • 324
  • 769
  • 1,199
0
votes
1 answer

flyway migrate fails with The connection attempt failed in docker-compose

I have these entries in my docker-compose.yml flyway: container_name: flyway image: flyway/flyway command: -url=jdbc:postgresql://postgresql:5432/db_name -schemas=public -user=username -password=password -connectRetries=60 migrate -X …
Sky
  • 15
  • 4
0
votes
0 answers

flyway s3 location NoClassDefFoundError

Trying to use flyway command line with locations pointing to s3 bucket. ./flyway -locations=s3://my-test-made-up-bucket-6955 -url=$url -user=$uname -password=$pwd migrate -X Output fails with java.lang.NoClassDefFoundError: Flyway Community Edition…
0
votes
1 answer

Flyway Repeatable Script Throwing Table Does Not Exist Error

I am currently trying to trim down my versioned scripts into one baseline script (we don't pay for flyway so is a pain). So I deleted my schema and attempted to run my one big script that contains everything I had. I exported the DDL out of my…
Beez
  • 478
  • 9
  • 23
0
votes
0 answers

How to rehash and clean existing entities in the database?

We have an entity and a corresponding table in the database with one additional column which contains digested hash of the entity fields, calculated each time programmatically in application. Entity has associations with two additional…
jimmayhem
  • 355
  • 2
  • 7
0
votes
1 answer

Clear cache after flyway migration script execution

I need to refresh my Redis cache every time some insert/update happens in the DB through a flyway migration script. Is there any way to achieve this? My application is written in Spring Boot.
Shamil Puthukkot
  • 442
  • 2
  • 17
0
votes
0 answers

Flyway doesn't create migrations to database

I'm new to flyway and I'm trying to create a migration of my database. I created V1_1__CREATE_TABLES.sql file in /resources/migrations, and started the app, but it just doesn't works. I also fiend a lot of threads on this topic, but all the answers…
Cross
  • 497
  • 1
  • 3
  • 13
0
votes
0 answers

JPA not creating tables it found at startup

I'm new to JPA and am working through examples on a UDemy course and got confused with the various Spring initialization on startup options. My entity is not being created on application startup, though as an H2 in-memory database it should because…
Woodsman
  • 901
  • 21
  • 61
0
votes
1 answer

Flyway vs Prisma Migrations

I'm migrating an existing TypeORM + PostgresQL project from TypeORM to Prisma. This existing project was handling migrations with Flyway: I wrote the SQL scripts to change the DB and those script were executed against de DB via Flyway. Now that I'm…
Juan Chaves
  • 81
  • 1
  • 4
0
votes
2 answers

Liquibase equivalent of beforeEachMigrate in Flyway

I am trying to find the Flyway's beforeEachMigrate equivalent functionality in liquibase. Does liquibase have a way to execute an SQL script before each new migration script is executed? My current liquibase structure looks like…
Philip John
  • 5,275
  • 10
  • 43
  • 68
0
votes
0 answers

Flyway adds suffix to table names in s3 location

I have a problem with file names in my s3 location after I use flyway migrate. Somehow the suffix is added to filenames and I don't know why. Example: I create a schema with a query: create schema MY_SCHEMA with…