use of org.flywaydb.core.internal.dbsupport.DbSupport in project flyway by flyway.
the class ConcurrentMigrationTestCase method setUp.
@Before
public void setUp() throws Exception {
File customPropertiesFile = new File(System.getProperty("user.home") + "/flyway-mediumtests.properties");
Properties customProperties = new Properties();
if (customPropertiesFile.canRead()) {
customProperties.load(new FileInputStream(customPropertiesFile));
}
concurrentMigrationDataSource = createDataSource(customProperties);
Connection connection = concurrentMigrationDataSource.getConnection();
final DbSupport dbSupport = DbSupportFactory.createDbSupport(connection, false);
schemaName = getSchemaName(dbSupport);
schemaQuoted = dbSupport.quote(schemaName);
connection.close();
flyway = createFlyway();
flyway.clean();
if (needsBaseline()) {
flyway.baseline();
}
}
use of org.flywaydb.core.internal.dbsupport.DbSupport in project flyway by flyway.
the class SQLServerCaseSensitiveMigrationTestCase method caseSensitiveCollation.
@Test
public void caseSensitiveCollation() throws Exception {
File customPropertiesFile = new File(System.getProperty("user.home") + "/flyway-mediumtests.properties");
Properties customProperties = new Properties();
if (customPropertiesFile.canRead()) {
customProperties.load(new FileInputStream(customPropertiesFile));
}
DataSource dataSource = createDataSource(customProperties);
Flyway flyway = new Flyway();
flyway.setDataSource(dataSource);
flyway.setLocations("migration/sql");
flyway.clean();
flyway.migrate();
assertEquals("2.0", flyway.info().current().getVersion().toString());
assertEquals(0, flyway.migrate());
assertEquals(4, flyway.info().applied().length);
Connection connection = dataSource.getConnection();
DbSupport dbSupport = DbSupportFactory.createDbSupport(connection, true);
assertEquals(2, dbSupport.getJdbcTemplate().queryForInt("select count(*) from all_misters"));
connection.close();
}
use of org.flywaydb.core.internal.dbsupport.DbSupport in project CzechIdMng by bcvsolutions.
the class IdmFlywayMigrationStrategy method resolveDbName.
/**
* Resolve dbName, which is used by {@Flyway} datasource.
*
* @param flyway
* @return
*/
public String resolveDbName(FlywayConfiguration flyway) {
Connection connection = JdbcUtils.openConnection(flyway.getDataSource());
DbSupport dbSupport = DbSupportFactory.createDbSupport(connection, false);
return dbSupport.getDbName();
}
Aggregations