add needed dependendencies for mysql and mssql (#3343)
* add mssql and mysql flyway dependencies * add exclusions to CQL to prevent duplicate classes on the classpath * wip * ad more databases * finish test
This commit is contained in:
parent
0df332763e
commit
3d4a0d89cf
|
@ -239,6 +239,14 @@
|
|||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-sqlserver</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-mysql</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test Deps -->
|
||||
<dependency>
|
||||
|
|
|
@ -95,6 +95,12 @@
|
|||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>${jaxb_api_version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>javax.activation</groupId>
|
||||
<artifactId>javax.activation-api</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jamesmurty.utils</groupId>
|
||||
|
|
|
@ -72,6 +72,15 @@
|
|||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-sqlserver</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-mysql</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-commons</artifactId>
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
import org.flywaydb.core.internal.database.DatabaseType;
|
||||
import org.flywaydb.core.internal.database.DatabaseTypeRegister;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.Matchers.is;
|
||||
|
||||
public class FlywayDbCompatibilityTest {
|
||||
@Test
|
||||
public void testFlywayDbCompatibility() {
|
||||
DatabaseType h2Type = DatabaseTypeRegister.getDatabaseTypeForUrl("jdbc:h2:mem:test");
|
||||
assertThat(h2Type.getName(), is(equalTo("H2")));
|
||||
|
||||
DatabaseType sqlServerType = DatabaseTypeRegister.getDatabaseTypeForUrl("jdbc:sqlserver://localhost:1433;database=test");
|
||||
assertThat(sqlServerType.getName(), is(equalTo("Azure Synapse")));
|
||||
|
||||
DatabaseType oracleType = DatabaseTypeRegister.getDatabaseTypeForUrl("jdbc:oracle:thin:@//host:port/service");
|
||||
assertThat(oracleType.getName(), is(equalTo("Oracle")));
|
||||
|
||||
DatabaseType mySqlType = DatabaseTypeRegister.getDatabaseTypeForUrl("jdbc:mysql://localhost:3306/cdr?serverTimezone=Canada/Eastern");
|
||||
assertThat(mySqlType.getName(), is(equalTo("MySQL")));
|
||||
|
||||
DatabaseType postgresType = DatabaseTypeRegister.getDatabaseTypeForUrl("jdbc:postgresql://localhost:5432/cdr");
|
||||
assertThat(postgresType.getName(), is(equalTo("CockroachDB")));
|
||||
|
||||
DatabaseType mariaDbType = DatabaseTypeRegister.getDatabaseTypeForUrl("jdbc:mariadb://localhost:3306/cdr");
|
||||
assertThat(mariaDbType.getName(), is(equalTo("MariaDB")));
|
||||
}
|
||||
|
||||
}
|
|
@ -6,6 +6,7 @@ import ca.uhn.fhir.jpa.migrate.tasks.api.ISchemaInitializationProvider;
|
|||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
||||
import org.flywaydb.core.api.migration.Context;
|
||||
import org.flywaydb.core.internal.database.DatabaseTypeRegister;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.extension.ExtendWith;
|
||||
import org.mockito.Mock;
|
||||
|
|
10
pom.xml
10
pom.xml
|
@ -1942,6 +1942,16 @@
|
|||
<artifactId>flyway-core</artifactId>
|
||||
<version>${flyway_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-sqlserver</artifactId>
|
||||
<version>${flyway_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-mysql</artifactId>
|
||||
<version>${flyway_version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.batch</groupId>
|
||||
<artifactId>spring-batch-test</artifactId>
|
||||
|
|
Loading…
Reference in New Issue