use of org.flywaydb.core.api.MigrationType in project flyway by flyway.
the class MyCustomMigrationResolver method resolveMigrations.
@Override
public List<ResolvedMigration> resolveMigrations() {
List<ResolvedMigration> resolvedMigrations = new ArrayList<ResolvedMigration>();
resolvedMigrations.add(new ResolvedMigration() {
@Override
public MigrationVersion getVersion() {
return MigrationVersion.fromVersion("1.9");
}
@Override
public String getDescription() {
return "Virtual Migration";
}
@Override
public String getScript() {
return "VirtualScript 1.9";
}
@Override
public Integer getChecksum() {
return 19;
}
@Override
public MigrationType getType() {
return MigrationType.CUSTOM;
}
@Override
public String getPhysicalLocation() {
return "virtual://loaction";
}
@Override
public MigrationExecutor getExecutor() {
return new MigrationExecutor() {
@Override
public void execute(Connection connection) {
System.out.println("Executed !");
}
@Override
public boolean executeInTransaction() {
return true;
}
};
}
});
return resolvedMigrations;
}
use of org.flywaydb.core.api.MigrationType in project flyway by flyway.
the class MigrationInfoImplSmallTest method validateFuture.
@Test
public void validateFuture() {
MigrationVersion version = MigrationVersion.fromVersion("1");
String description = "test";
MigrationType type = MigrationType.SQL;
AppliedMigration appliedMigration = new AppliedMigration(1, version, description, type, null, 123, new Date(), "abc", 0, true);
MigrationInfoImpl migrationInfo = new MigrationInfoImpl(null, appliedMigration, new MigrationInfoContext(), false);
String message = migrationInfo.validate();
assertTrue(message, message.contains("not resolved"));
}
use of org.flywaydb.core.api.MigrationType in project flyway by flyway.
the class MigrationInfoImplSmallTest method validate.
@Test
public void validate() {
MigrationVersion version = MigrationVersion.fromVersion("1");
String description = "test";
MigrationType type = MigrationType.SQL;
ResolvedMigrationImpl resolvedMigration = new ResolvedMigrationImpl();
resolvedMigration.setVersion(version);
resolvedMigration.setDescription(description);
resolvedMigration.setType(type);
resolvedMigration.setChecksum(456);
AppliedMigration appliedMigration = new AppliedMigration(1, version, description, type, null, 123, new Date(), "abc", 0, true);
MigrationInfoImpl migrationInfo = new MigrationInfoImpl(resolvedMigration, appliedMigration, new MigrationInfoContext(), false);
String message = migrationInfo.validate();
assertTrue(message.contains("123"));
assertTrue(message.contains("456"));
}
Aggregations