use of org.flywaydb.core.api.MigrationVersion in project flyway by flyway.
the class H2MigrationMediumTest method dollarQuotedString.
@Test
public void dollarQuotedString() throws Exception {
flyway.setLocations("migration/dbsupport/h2/sql/dollar_quoted_string");
flyway.migrate();
MigrationVersion version = flyway.info().current().getVersion();
assertEquals("1.1", version.toString());
assertEquals("Populate table", flyway.info().current().getDescription());
assertEquals("'Mr. Semicolon+Linebreak;\nanother line'", jdbcTemplate.queryForString("select name from test_user where name like '%line'''"));
}
use of org.flywaydb.core.api.MigrationVersion in project flyway by flyway.
the class H2MigrationMediumTest method sequence.
@Test
public void sequence() throws Exception {
flyway.setLocations("migration/dbsupport/h2/sql/sequence");
flyway.migrate();
MigrationVersion version = flyway.info().current().getVersion();
assertEquals("1", version.toString());
assertEquals("Sequence", flyway.info().current().getDescription());
assertEquals(666, jdbcTemplate.queryForInt("select nextval('the_beast')"));
flyway.clean();
flyway.migrate();
}
use of org.flywaydb.core.api.MigrationVersion in project flyway by flyway.
the class DB2zOSMigrationMediumTest method sequence.
@Test
public void sequence() throws Exception {
flyway.setLocations(getSequenceLocation());
flyway.baseline();
flyway.migrate();
MigrationVersion migrationVersion = flyway.info().current().getVersion();
assertEquals("1.1", migrationVersion.toString());
assertEquals("Sequence", flyway.info().current().getDescription());
assertEquals(666, jdbcTemplate.queryForInt("SELECT NEXTVAL FOR AURINT.beast_seq FROM sysibm.sysdummy1"));
}
use of org.flywaydb.core.api.MigrationVersion in project flyway by flyway.
the class OracleMigrationMediumTest method migrationsWithPlaceholders.
/**
* Tests migrations containing placeholders.
*/
@Test
public void migrationsWithPlaceholders() throws Exception {
int countUserObjects1 = jdbcTemplate.queryForInt("SELECT count(*) FROM user_objects");
Map<String, String> placeholders = new HashMap<String, String>();
placeholders.put("tableName", "test_user");
flyway.setPlaceholders(placeholders);
flyway.setLocations("migration/dbsupport/oracle/sql/placeholders");
flyway.migrate();
MigrationVersion version = flyway.info().current().getVersion();
assertEquals("1.1", version.toString());
assertEquals("Populate table", flyway.info().current().getDescription());
assertEquals("Mr. T triggered", jdbcTemplate.queryForString("select name from test_user"));
flyway.clean();
int countUserObjects2 = jdbcTemplate.queryForInt("SELECT count(*) FROM user_objects");
assertEquals(countUserObjects1, countUserObjects2);
MigrationInfo[] migrationInfos = flyway.info().applied();
for (MigrationInfo migrationInfo : migrationInfos) {
assertNotNull(migrationInfo.getScript() + " has no checksum", migrationInfo.getChecksum());
}
}
use of org.flywaydb.core.api.MigrationVersion in project flyway by flyway.
the class SapHanaMigrationMediumTest method synonym.
@Test
public void synonym() throws Exception {
flyway.setLocations("migration/dbsupport/saphana/sql/synonym");
flyway.migrate();
MigrationVersion version = flyway.info().current().getVersion();
assertEquals("1", version.toString());
assertEquals("Synonym", flyway.info().current().getDescription());
flyway.clean();
flyway.migrate();
}
Aggregations