0

I am using flyway db version 6.0.8 in my local macbook pro with MySQL Database Integration. I have placed a create table script under ~/sql and using below command to migrate. However its not creating table its only creating "flyway_schema_history" but not the actual table.

Conf file:

flyway.user=flyway flyway.url=jdbc:mysql://127.0.0.1:3306/db 

Below are the flyway logs:-

Flyway Community Edition 6.0.8 by Redgate Database: jdbc:mysql://127.0.0.1:3306/DB (MySQL 8.0) Successfully validated 0 migrations (execution time 00:00.005s) Creating Schema History table `db`.`flyway_schema_history` with baseline ... Successfully baselined schema with version: 1 Current version of schema `db`: 1 Schema `db` is up to date. No migration necessary.``` 
1
  • Where exactly did you place the migration scripts? I think Flyway expects them to be inside of the jar file of your application. Commented Jan 16, 2020 at 12:31

2 Answers 2

2

Flyway follows the simple path. And that is convention. When creating Flyway migration file or even locating it, you have to follow conventions.

For example, the path cannot be some random folder:

enter image description here

Also the naming:

The file name consists of the following parts:

Prefix: V for versioned (configurable), U for undo (configurable) and R for repeatable migrations (configurable)

Version: Version with dots or underscores separate as many parts as you like (Not for repeatable migrations)

Separator: __ (two underscores) (configurable)

Description: Underscores or spaces separate the words

Suffix: .sql (configurable)

Resource : https://flywaydb.org/documentation/migrations

Sign up to request clarification or add additional context in comments.

Comments

1

If you run flyway with the -X parameter, it will print out the locations it is searching for migrations.

e.g. flyway migrate -X

This should help you figure out where it is searching, vs where you have put your migration files.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.