Skip to content

Commit 230a305

Browse files
authored
Merge pull request eugenp#652 from sanketmeghani/master
Database migration using flyway
2 parents 15dd97b + 9dc0c05 commit 230a305

4 files changed

Lines changed: 50 additions & 0 deletions

File tree

‎flyway-migration/.gitignore‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.classpath
2+
.project
3+
.settings
4+
target/
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CREATE TABLE IF NOT EXISTS `employee` (
2+
3+
`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
4+
`name` varchar(20),
5+
`email` varchar(50),
6+
`date_of_birth` timestamp
7+
8+
)ENGINE=InnoDB DEFAULT CHARSET=UTF8;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
flyway.user=root
2+
flyway.password=mysql
3+
flyway.schemas=app-db
4+
flyway.url=jdbc:mysql://localhost:3306/
5+
flyway.locations=filesystem:db/migration

‎flyway-migration/pom.xml‎

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<groupId>com.baeldung</groupId>
5+
<artifactId>flyway-migration</artifactId>
6+
<version>1.0</version>
7+
<name>flyway-migration</name>
8+
<description>A sample project to demonstrate Flyway migrations</description>
9+
<dependencies>
10+
<dependency>
11+
<groupId>mysql</groupId>
12+
<artifactId>mysql-connector-java</artifactId>
13+
<version>6.0.3</version>
14+
</dependency>
15+
</dependencies>
16+
<build>
17+
<plugins>
18+
<plugin>
19+
<groupId>org.flywaydb</groupId>
20+
<artifactId>flyway-maven-plugin</artifactId>
21+
<version>4.0.3</version>
22+
</plugin>
23+
<plugin>
24+
<groupId>org.apache.maven.plugins</groupId>
25+
<artifactId>maven-compiler-plugin</artifactId>
26+
<configuration>
27+
<source>1.8</source>
28+
<target>1.8</target>
29+
</configuration>
30+
</plugin>
31+
</plugins>
32+
</build>
33+
</project>

0 commit comments

Comments
 (0)