Reputation:
I have a maven project and I am trying to create tables with flyway using a MySQL script.
My configuration file consists as
flyway.driver=com.mysql.jdbc.Driver
flyway.url=jdbc:mysql://127.0.0.1:3306/atm
flyway.user=root
flyway.password=root1234
flyway.locations=filesystem:/flyway/migrations
flyway.sqlMigrationPrefix=V
flyway.sqlMigrationSeparator=__
flyway.validateOnMigrate=true
This is the SQL script file.
CREATE TABLE `atm_table` (
`id` int(11) NOT NULL,
`name` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
When I execute the command mvn flyway:migrate -X
it only creates the flyway_schema_history
table. In the logs, it shows as
[DEBUG] Unable to load config file: /Users/name/flyway.conf
[DEBUG] Loading config file: /Users/name/my-project/flyway/conf/flyway.conf
Loading class 'com.mysql.jdbc.Driver'. This is deprecated. The new driver class is 'com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
[INFO] Flyway Community Edition 6.5.0 by Redgate
[DEBUG] Scanning for filesystem resources at '/my-project/flyway/migrations'
[WARNING] Skipping filesystem location:/my-project/flyway/migrations (not found). Note this warning will become an error in Flyway 7.
Wed Sep 16 16:32:45 IST 2020 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
Seems like it is not referring to the correct file location (the location given in the config file). How to fix this issue?
Upvotes: 0
Views: 646
Reputation: 2805
It's the naming on the file. Looks like you have a single underscore after the version. You need to have two (2). This is an easy mistake to made. I know because I messed it up royally. Here's an article on it.
If you don't have the right naming standard, Flyway will ignore the file.
Upvotes: 1