[BAEL4288] remove mysql flow

This commit is contained in:
Adrian Maghear 2020-07-17 15:13:57 +02:00
parent be1f906a9a
commit 8a98cce3db
12 changed files with 11 additions and 56 deletions

View File

@ -1,2 +1 @@
MYSQL_PORT=3316
POSTGRES_PORT=5431

View File

@ -1,14 +1,6 @@
version: '3.0'
services:
mysql-test:
image: mysql:8.0.17
ports:
- ${MYSQL_PORT}:3306
env_file:
- mysql.env
networks:
- baeldung
postgres-test:
image: postgres:11.5

View File

@ -1,5 +0,0 @@
MYSQL_ROOT_PASSWORD=password
MYSQL_RANDOM_ROOT_PASSWORD=yes
MYSQL_USER=testuser
MYSQL_PASSWORD=password
MYSQL_DATABASE=testdb

View File

@ -18,7 +18,6 @@
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway-core.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -31,37 +30,23 @@
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>${flyway-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>*.properties</include>
<include>db/**/*.sql</include>
</includes>
</resource>
</resources>
</build>
<properties>
<flyway-core.version>6.5.0</flyway-core.version>
<flyway-maven-plugin.version>6.5.0</flyway-maven-plugin.version>
<flyway.configFiles>src/main/resources/application-${db.engine}.properties</flyway.configFiles>
</properties>
<profiles>
<profile>
<id>h2</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<db.engine>h2</db.engine>
<spring-boot.run.profiles>h2</spring-boot.run.profiles>
</properties>
<dependencies>
<dependency>
@ -72,24 +57,10 @@
</dependencies>
</profile>
<profile>
<id>mysql</id>
<properties>
<db.engine>mysql</db.engine>
</properties>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
</profile>
<profile>
<id>postgres</id>
<properties>
<db.engine>postgres</db.engine>
<spring-boot.run.profiles>postgres</spring-boot.run.profiles>
</properties>
<dependencies>
<dependency>
@ -102,4 +73,8 @@
</profiles>
<properties>
<flyway.configFiles>src/main/resources/application-${spring-boot.run.profiles}.properties</flyway.configFiles>
</properties>
</project>

View File

@ -1 +1 @@
flyway.locations=db/migration,db/callbacks
spring.flyway.locations=classpath:db/migration,classpath:db/callback

View File

@ -1,3 +0,0 @@
flyway.url=jdbc:mysql://127.0.0.1:3316/testdb
flyway.user=testuser
flyway.password=password

View File

@ -1,6 +1,3 @@
spring.profiles.include=@db.engine@
spring.datasource.url=${flyway.url}
spring.datasource.username=${flyway.user}
spring.datasource.password=${flyway.password}
spring.flyway.locations=${flyway.locations:db/migration}

View File

@ -1,3 +1,3 @@
create table table_one (
create table table_four (
id numeric primary key
);