Reputation: 647
I am trying to integrate flyway library into the spring-boot project using h2 and yaml properties. Unfortunately while starting the application I did not receive any logs that the Flyway is started and also I cannot see the table under the h2-console. (I see another tables created by hibernate)
This is my code:
pom.xml
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>6.5.0</version>
</plugin>
application.yml
spring:
h2:
console:
enabled: true
path: /h2-console
datasource:
url: jdbc:h2:file:~/testdb
username: sa
password:
driverClassName: org.h2.Driver
jpa:
hibernate.ddl-auto: none
show-sql: true
flyway:
enabled: true
locations: filesystem:/db/migration
V1_0__init.sql under src/main/resources/db/migration
CREATE TABLE TEST_USERS (ID INT AUTO_INCREMENT PRIMARY KEY, USERID VARCHAR(45));
INSERT INTO USERS (ID, USERID) VALUES (1, 'TEST.com');
Any ideas what is wrong?
Upvotes: 0
Views: 2539
Reputation: 1450
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
flyway:
locations: classpath:/db/migration
Then youshould see flyway logs on startup.
For more informations: 10.6.1. Execute Flyway Database Migrations on Startup
Upvotes: 1