public void info() throws FlywayException { MigrationInfoService info = flyway.info(); System.out.println(MigrationInfoDumper.dumpToAsciiTable(info.all())); }
private static MigrationVersion getDatabaseVersion(DataSource dataSource) throws FlywayException { Flyway flyway = new Flyway(); flyway.setDataSource(dataSource); MigrationInfoService info = flyway.info(); MigrationVersion currentVersion = MigrationVersion.EMPTY; if (info.current() != null) { currentVersion = info.current().getVersion(); } return currentVersion; }
@Override protected Object run(Flyway flyway) { MigrationInfoService info = flyway.info(); MigrationInfo current = info.current(); MigrationVersion currentSchemaVersion = current == null ? MigrationVersion.EMPTY : current.getVersion(); System.out.println("Schema version: " + currentSchemaVersion); System.out.println(MigrationInfoDumper.dumpToAsciiTable(info.all())); return null; } }
switch (revision) { case "current": entity = flyway.info().current(); break; case "pending": entity = flyway.info().pending(); break; case "applied": entity = flyway.info().applied(); break; case "first": { MigrationInfo[] migrationInfos = flyway.info().all(); if (migrationInfos.length == 0) throw new NotFoundException(); entity = resolved(flyway.info().all()); break; case "failed": entity = failed(flyway.info().all()); break; case "future": entity = future(flyway.info().all()); break; case "latest": { MigrationInfo[] migrationInfos = flyway.info().all(); if (migrationInfos.length == 0) throw new NotFoundException(); for (MigrationInfo info : flyway.info().all()) {
MigrationInfo[] pending = flyway.info().pending();
flyway.validate(); } else if ("info".equals(operation)) { LOG.info("\n" + MigrationInfoDumper.dumpToAsciiTable(flyway.info().all())); } else if ("repair".equals(operation)) { flyway.repair();
private static MigrationVersion getDatabaseVersion(DataSource dataSource) throws FlywayException { Flyway flyway = new Flyway(); flyway.setDataSource(dataSource); MigrationInfoService info = flyway.info(); MigrationVersion currentVersion = MigrationVersion.EMPTY; if (info.current() != null) { currentVersion = info.current().getVersion(); } return currentVersion; }
@ReadOperation public ApplicationFlywayBeans flywayBeans() { ApplicationContext target = this.context; Map<String, ContextFlywayBeans> contextFlywayBeans = new HashMap<>(); while (target != null) { Map<String, FlywayDescriptor> flywayBeans = new HashMap<>(); target.getBeansOfType(Flyway.class).forEach((name, flyway) -> flywayBeans .put(name, new FlywayDescriptor(flyway.info().all()))); ApplicationContext parent = target.getParent(); contextFlywayBeans.put(target.getId(), new ContextFlywayBeans(flywayBeans, (parent != null) ? parent.getId() : null)); target = parent; } return new ApplicationFlywayBeans(contextFlywayBeans); }
private static MigrationVersion getDatabaseVersion(DataSource dataSource) throws FlywayException { Flyway flyway = new Flyway(); flyway.setDataSource(dataSource); MigrationInfoService info = flyway.info(); MigrationVersion currentVersion = MigrationVersion.EMPTY; if (info.current() != null) { currentVersion = info.current().getVersion(); } return currentVersion; }
@Override public void run(final Namespace namespace, final Flyway flyway) throws Exception { System.out.println(dumpToAsciiTable(flyway.info().all())); } }
@Override public String getSchemaVersion() throws TopiaMigrationServiceException { MigrationInfo currentOrNull = flyway.info().current(); if (currentOrNull == null) { throw new TopiaMigrationServiceException("schema version is unknown"); } String schemaVersion = currentOrNull.getVersion().getVersion(); return schemaVersion; }
public void info() throws FlywayException { MigrationInfoService info = flyway.info(); System.out.println(MigrationInfoDumper.dumpToAsciiTable(info.all())); }
@Override public void migrate(Flyway flyway) { MigrationInfo current = flyway.info().current(); if (current != null && current.getVersion().equals(INITIAL) && current.getType() == MigrationType.SQL) { logger.info("Detected initial version based on SQL scripts, doing repair to switch to Java based migrations."); flyway.repair(); } flyway.migrate(); } }
public void info() throws FlywayException { MigrationInfoService info = flyway.info(); System.out.println(MigrationInfoDumper.dumpToAsciiTable(info.all())); }
private void info() { System.out.println(dumpToAsciiTable(flyway.info().all())); }
private void info() { System.out.println(dumpToAsciiTable(flyway.info().all())); }
private void info() { System.out.println(dumpToAsciiTable(flyway.info().all())); }
private void info() { System.out.println(dumpToAsciiTable(flyway.info().all())); }