use of org.flywaydb.core.internal.resolver.ResolvedMigrationImpl in project flyway by flyway.
the class MigrationInfoServiceImplSmallTest method createResolvedMigration.
/**
* Creates a new resolved migration with this version.
*
* @param version The version of the migration.
* @return The resolved migration.
*/
private ResolvedMigration createResolvedMigration(int version) {
ResolvedMigrationImpl migration = new ResolvedMigrationImpl();
migration.setVersion(MigrationVersion.fromVersion(Integer.toString(version)));
migration.setDescription("abc");
migration.setScript("x");
migration.setType(MigrationType.SQL);
return migration;
}
use of org.flywaydb.core.internal.resolver.ResolvedMigrationImpl in project ArachneCentralAPI by OHDSI.
the class ApplicationContextAwareSpringJdbcMigrationResolver method resolveMigrations.
@SuppressWarnings("unchecked")
@Override
public Collection<ResolvedMigration> resolveMigrations() {
// get all beans of type ApplicationContextAwareSpringMigration from the application context
Map<String, ApplicationContextAwareSpringMigration> springJdbcMigrationBeans = this.applicationContext.getBeansOfType(ApplicationContextAwareSpringMigration.class);
ArrayList<ResolvedMigration> resolvedMigrations = new ArrayList<ResolvedMigration>();
// resolve the migration and populate it with the migration info
for (ApplicationContextAwareSpringMigration springJdbcMigrationBean : springJdbcMigrationBeans.values()) {
ResolvedMigrationImpl resolvedMigration = extractMigrationInfo(springJdbcMigrationBean);
resolvedMigration.setPhysicalLocation(ClassUtils.getLocationOnDisk(springJdbcMigrationBean.getClass()));
resolvedMigration.setExecutor(new ApplicationContextAwareSpringJdbcMigrationExecutor(springJdbcMigrationBean));
resolvedMigrations.add(resolvedMigration);
}
Collections.sort(resolvedMigrations, new ResolvedMigrationComparator());
return resolvedMigrations;
}
Aggregations