Reputation: 1
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.```
Upvotes: 0
Views: 309
Reputation: 176
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.
Upvotes: 1
Reputation: 1682
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:
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
Upvotes: 2