use of org.flywaydb.core.internal.resolver.ResolvedMigrationComparator in project flyway by flyway.
the class SqlMigrationResolver method resolveMigrations.
public List<ResolvedMigration> resolveMigrations() {
List<ResolvedMigration> migrations = new ArrayList<ResolvedMigration>();
scanForMigrations(migrations, configuration.getSqlMigrationPrefix(), configuration.getSqlMigrationSeparator(), configuration.getSqlMigrationSuffix());
scanForMigrations(migrations, configuration.getRepeatableSqlMigrationPrefix(), configuration.getSqlMigrationSeparator(), configuration.getSqlMigrationSuffix());
Collections.sort(migrations, new ResolvedMigrationComparator());
return migrations;
}
use of org.flywaydb.core.internal.resolver.ResolvedMigrationComparator 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;
}
use of org.flywaydb.core.internal.resolver.ResolvedMigrationComparator in project flyway by flyway.
the class SqlMigrationResolver method resolveMigrations.
public List<ResolvedMigration> resolveMigrations(Context context) {
List<ResolvedMigration> migrations = new ArrayList<>();
String[] suffixes = configuration.getSqlMigrationSuffixes();
addMigrations(migrations, configuration.getSqlMigrationPrefix(), suffixes, false);
addMigrations(migrations, configuration.getRepeatableSqlMigrationPrefix(), suffixes, true);
migrations.sort(new ResolvedMigrationComparator());
return migrations;
}
Aggregations