Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flyway db migration folder

Tags:

flyway

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.

like image 396
TechArch Avatar asked Apr 02 '14 18:04

TechArch


People also ask

Where are Flyway migrations stored?

By default both versioned and repeatable migrations can be written either in SQL or in Java and can consist of multiple statements. Flyway automatically discovers migrations on the filesystem and on the Java classpath.

What is Flyway DB migration?

Flyway is an open-source database migration tool. It strongly favors simplicity and convention over configuration. It is based around just 7 basic commands: Migrate, Clean, Info, Validate, Undo, Baseline and Repair.


1 Answers

By default Flyway will look for migrations on the classpath under db/migration, which on a Maven project means src/main/resources/db/migration.

You can however also use a location starting with the filesystem: prefix that can be anywhere on your disk.

See the ”Location and discovery“ section of the SQL-based migrations documentation page.

For command-line use, see the locations option on the migrate command reference page.

like image 119
Axel Fontaine Avatar answered Oct 22 '22 01:10

Axel Fontaine