@Override @SuppressWarnings("UseOfSystemOutOrSystemErr") protected void run(@Nullable Bootstrap<T> bootstrap, Namespace namespace, T configuration) throws Exception { final PooledDataSourceFactory dbConfig = strategy.getDataSourceFactory(configuration); dbConfig.asSingleConnectionPool(); try (final CloseableLiquibase liquibase = openLiquibase(dbConfig, namespace)) { run(namespace, liquibase); } catch (ValidationFailedException e) { e.printDescriptiveError(System.err); throw e; } }
@Override public ValidationErrors validate(Database database) { return new ValidationErrors(); } }
private void generateChangeLog(final Database database, final CatalogAndSchema catalogAndSchema, final DiffToChangeLog changeLogWriter, PrintStream outputStream, final Set<Class<? extends DatabaseObject>> compareTypes) throws DatabaseException, IOException, ParserConfigurationException { @SuppressWarnings("unchecked") final SnapshotControl snapshotControl = new SnapshotControl(database, compareTypes.toArray(new Class[compareTypes.size()])); final CompareControl compareControl = new CompareControl(new CompareControl.SchemaComparison[]{ new CompareControl.SchemaComparison(catalogAndSchema, catalogAndSchema)}, compareTypes); final CatalogAndSchema[] compareControlSchemas = compareControl .getSchemas(CompareControl.DatabaseRole.REFERENCE); try { final DatabaseSnapshot referenceSnapshot = SnapshotGeneratorFactory.getInstance() .createSnapshot(compareControlSchemas, database, snapshotControl); final DatabaseSnapshot comparisonSnapshot = SnapshotGeneratorFactory.getInstance() .createSnapshot(compareControlSchemas, null, snapshotControl); final DiffResult diffResult = DiffGeneratorFactory.getInstance() .compare(referenceSnapshot, comparisonSnapshot, compareControl); changeLogWriter.setDiffResult(diffResult); changeLogWriter.print(outputStream); } catch (InvalidExampleException e) { throw new UnexpectedLiquibaseException(e); } }
private void handleError(JdbcConnection connection, Exception e) throws DatabaseException, CustomChangeException { connection.rollback(); throw new CustomChangeException(e); } }
private void handleError(JdbcConnection connection, Exception e) throws DatabaseException, CustomChangeException { connection.rollback(); throw new CustomChangeException(e); }
/** * @see liquibase.change.custom.CustomChange#validate(Database) */ @Override public ValidationErrors validate(Database db) { return new ValidationErrors(); } }
@Override @SuppressWarnings("UseOfSystemOutOrSystemErr") protected void run(Bootstrap<T> bootstrap, Namespace namespace, T configuration) throws Exception { final PooledDataSourceFactory dbConfig = strategy.getDataSourceFactory(configuration); dbConfig.asSingleConnectionPool(); try (final CloseableLiquibase liquibase = openLiquibase(dbConfig, namespace)) { run(namespace, liquibase); } catch (ValidationFailedException e) { e.printDescriptiveError(System.err); throw e; } }
private void handleError(JdbcConnection connection, Exception e) throws DatabaseException, CustomChangeException { connection.rollback(); throw new CustomChangeException(e); }
/** * @see liquibase.change.custom.CustomChange#validate(liquibase.database.Database) */ @Override public ValidationErrors validate(Database database) { return new ValidationErrors(); }
private void handleError(JdbcConnection connection, Exception e) throws DatabaseException, CustomChangeException { connection.rollback(); throw new CustomChangeException(e); }
/** * @see liquibase.change.custom.CustomChange#validate(liquibase.database.Database) */ @Override public ValidationErrors validate(Database database) { return new ValidationErrors(); } }
private void handleError(JdbcConnection connection, Exception e) throws DatabaseException, CustomChangeException { connection.rollback(); throw new CustomChangeException(e); }
/** * @see CustomChange#validate(Database) */ @Override public ValidationErrors validate(Database db) { return new ValidationErrors(); } }
@Override public void execute(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); try { List<DiscontinuedOrder> discontinuedOrders = getDiscontinuedOrders(connection); createDiscontinueOrders(connection, discontinuedOrders); } catch (SQLException | DatabaseException e) { throw new CustomChangeException(e); } }
/** * @see liquibase.change.custom.CustomChange#validate(liquibase.database.Database) */ @Override public ValidationErrors validate(Database database) { return new ValidationErrors(); } }
@Override public void execute(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); try { List<List<Object>> usersAndProviders = getUsersAndProviders(connection); convertOrdererToProvider(connection, usersAndProviders); } catch (Exception e) { throw new CustomChangeException(e); } }
/** * @see liquibase.change.custom.CustomChange#validate(liquibase.database.Database) */ @Override public ValidationErrors validate(Database database) { return new ValidationErrors(); }
@Override public void execute(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); try { Set<String> uniqueFrequencies = DatabaseUtil.getUniqueNonNullColumnValues("frequency_text", "drug_order", String.class, connection.getUnderlyingConnection()); insertUniqueFrequencies(connection, uniqueFrequencies); } catch (Exception e) { throw new CustomChangeException(e); } }
@Override public ValidationErrors validate(Database database) { return new ValidationErrors(); } }
@Override public void execute(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); try { Set<String> uniqueFrequencies = DatabaseUtil.getUniqueNonNullColumnValues("frequency_text", "drug_order", String.class, connection.getUnderlyingConnection()); migrateFrequenciesToCodedValue(connection, uniqueFrequencies); } catch (Exception e) { throw new CustomChangeException(e); } }