liquibase.Liquibase.futureRollbackSQL()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(209)

本文整理了Java中liquibase.Liquibase.futureRollbackSQL()方法的一些代码示例,展示了Liquibase.futureRollbackSQL()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Liquibase.futureRollbackSQL()方法的具体详情如下:
包路径:liquibase.Liquibase
类名称:Liquibase
方法名:futureRollbackSQL

Liquibase.futureRollbackSQL介绍

暂无

代码示例

代码示例来源:origin: dropwizard/dropwizard

@Override
public void run(Namespace namespace, Liquibase liquibase) throws Exception {
  final String context = getContext(namespace);
  final Integer count = namespace.getInt("count");
  if (count != null) {
    liquibase.futureRollbackSQL(count, context, new OutputStreamWriter(outputStream, StandardCharsets.UTF_8));
  } else {
    liquibase.futureRollbackSQL(context, new OutputStreamWriter(outputStream, StandardCharsets.UTF_8));
  }
}

代码示例来源:origin: io.dropwizard/dropwizard-migrations

@Override
public void run(Namespace namespace, Liquibase liquibase) throws Exception {
  final String context = getContext(namespace);
  final Integer count = namespace.getInt("count");
  if (count != null) {
    liquibase.futureRollbackSQL(count, context, new OutputStreamWriter(outputStream, StandardCharsets.UTF_8));
  } else {
    liquibase.futureRollbackSQL(context, new OutputStreamWriter(outputStream, StandardCharsets.UTF_8));
  }
}

代码示例来源:origin: org.liquibase/liquibase-maven-plugin

@Override
protected void performLiquibaseTask(Liquibase liquibase) throws LiquibaseException {
  liquibase.futureRollbackSQL(new Contexts(contexts), new LabelExpression(labels), outputWriter);
}

代码示例来源:origin: com.expanset.utils/utils-dbmigration

liquidbase.rollback(count, context, dbMaintenance.createConsoleOutput());
} else {
  liquidbase.futureRollbackSQL(context, dbMaintenance.createConsoleOutput());
  liquidbase.rollback(count, context);
} else {
  liquidbase.futureRollbackSQL(context, dbMaintenance.createConsoleOutput());

代码示例来源:origin: stackoverflow.com

public void verify(DataSource ds) {
   boolean throwException = false;
   Contexts contexts = new Contexts("");
   for(LiquibaseConfiguration c : configs) {
     try(Connection con = ds.getConnection()) {
         Database db = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(new JdbcConnection(con));
         db.setDatabaseChangeLogLockTableName(c.changeLogLockTableName());
         db.setDatabaseChangeLogTableName(c.changeLogTableName());
         Liquibase liquibase = new ShureviewNonCreationLiquibase(c.liquibaseResource(), new ClassLoaderResourceAccessor(), db);
         liquibase.getLog();
         liquibase.validate();
         List<ChangeSet> listUnrunChangeSets = liquibase.listUnrunChangeSets(contexts, new LabelExpression());
         if(!listUnrunChangeSets.isEmpty()) {
           StringWriter writer = new StringWriter();
           liquibase.update(contexts, writer);
           liquibase.futureRollbackSQL(writer);
           log.warn(writer.toString());
           throwException = true;
         }
     } catch (SQLException | LiquibaseException e) {
       throw new RuntimeException("Failed to verify database.", e);
     }
   }
   if(throwException){
     throw new RuntimeException("Unrun changesets in chengelog.");
   }
 }

代码示例来源:origin: OpenClinica/OpenClinica

private void generateRollbackFile(Liquibase liquibase) throws LiquibaseException {
  if (this.rollbackFile != null) {
    OutputStreamWriter output = null;
    try {
      output = new OutputStreamWriter(new FileOutputStream(this.rollbackFile), ((GlobalConfiguration)LiquibaseConfiguration.getInstance().getConfiguration(GlobalConfiguration.class)).getOutputEncoding());
      if (this.tag != null) {
        liquibase.futureRollbackSQL(this.tag, new Contexts(this.getContexts()), new LabelExpression(this.getLabels()), output);
      } else {
        liquibase.futureRollbackSQL(new Contexts(this.getContexts()), new LabelExpression(this.getLabels()), output);
      }
    } catch (IOException var11) {
      throw new LiquibaseException("Unable to generate rollback file.", var11);
    } finally {
      try {
        if (output != null) {
          output.close();
        }
      } catch (IOException var10) {
        this.log.severe("Error closing output", var10);
      }
    }
  }
}

代码示例来源:origin: stackoverflow.com

StringWriter writer = new StringWriter();
liquibase.update(contexts, writer);
liquibase.futureRollbackSQL(writer);
log.warn(writer.toString());
throwException = true;

相关文章