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

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

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

Liquibase.dropAll介绍

暂无

代码示例

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

@Override
  public void run(Namespace namespace, Liquibase liquibase) throws Exception {
    liquibase.dropAll();
  }
}

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

@Override
  public void run(Namespace namespace, Liquibase liquibase) throws Exception {
    liquibase.dropAll();
  }
}

代码示例来源:origin: org.xipki.tk/database-tool

public void dropAll() throws Exception {
  liquibase.dropAll();
  System.out.println("successfully  dropped the database");
}

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

@Override
protected void performLiquibaseTask(Liquibase liquibase)
    throws LiquibaseException {
  if (schemas != null) {
    List<CatalogAndSchema> schemaObjs = new ArrayList<>();
    for (String name : schemas.split(",")) {
      schemaObjs.add(new CatalogAndSchema(catalog, name));
    }
    liquibase.dropAll(schemaObjs.toArray(new CatalogAndSchema[schemaObjs.size()]));
  } else {
    liquibase.dropAll();
  }
}

代码示例来源:origin: org.aktin/broker-server

public void reset() throws LiquibaseException{
  liquibase.dropAll();
  update();
}

代码示例来源:origin: org.flowable/flowable-dmn-engine

public void initSchema(DmnEngineConfiguration dmnEngineConfiguration, String databaseSchemaUpdate) {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(dmnEngineConfiguration);
    if (DmnEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Dropping and creating schema DMN");
      liquibase.dropAll();
      liquibase.update("dmn");
    } else if (DmnEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Updating schema DMN");
      liquibase.update("dmn");
    } else if (DmnEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Validating schema DMN");
      liquibase.validate();
    }
  } catch (Exception e) {
    throw new FlowableException("Error initialising dmn data model", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-form-engine

@Override
public void schemaDrop() {
  Liquibase liquibase = createLiquibaseInstance();
  try {
    liquibase.dropAll();
  } catch (Exception e) {
    throw new FlowableException("Error dropping form engine tables", e);
  } finally {
    closeDatabase(liquibase);
  }
}

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

protected Liquibase createLiquibase(Connection c) throws LiquibaseException {
  Liquibase liquibase = new Liquibase(config.getChangeLog(), resourceAccessor, createDatabase(c));
  if (config.getParameters() != null) {
    for(Map.Entry<String, String> entry: config.getParameters().entrySet()) {
      liquibase.setChangeLogParameter(entry.getKey(), entry.getValue());
    }
  }
  if (config.isDropFirst()) {
    liquibase.dropAll();
  }
  return liquibase;
}

代码示例来源:origin: org.flowable/flowable-content-engine

public void initSchema(ContentEngineConfiguration configuration, String databaseSchemaUpdate) {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(configuration);
    if (ContentEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Dropping and creating schema Content");
      liquibase.dropAll();
      liquibase.update("content");
    } else if (ContentEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Updating schema Content");
      liquibase.update("content");
    } else if (ContentEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Validating schema Content");
      liquibase.validate();
    }
  } catch (Exception e) {
    throw new FlowableException("Error initialising Content schema", e);
  } finally {
    closeDatabase(liquibase);
  }
}

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

protected Liquibase createLiquibase(Connection c) throws LiquibaseException {
  CustomSpringLiquibase.SpringResourceOpener resourceAccessor = this.createResourceOpener();
  Liquibase liquibase = new Liquibase(this.getChangeLog(), resourceAccessor, this.createDatabase(c, resourceAccessor));
  liquibase.setIgnoreClasspathPrefix(this.isIgnoreClasspathPrefix());
  if (this.parameters != null) {
    Iterator i$ = this.parameters.entrySet().iterator();
    while(i$.hasNext()) {
      Entry<String, String> entry = (Entry)i$.next();
      liquibase.setChangeLogParameter((String)entry.getKey(), entry.getValue());
    }
  }
  if (this.isDropFirst()) {
    liquibase.dropAll();
  }
  return liquibase;
}

代码示例来源:origin: org.flowable/flowable-form-engine

public void initSchema(FormEngineConfiguration formEngineConfiguration) {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(formEngineConfiguration);
    String databaseSchemaUpdate = formEngineConfiguration.getDatabaseSchemaUpdate();
    if (FormEngineConfiguration.DB_SCHEMA_UPDATE_DROP_CREATE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Dropping and creating schema FORM");
      liquibase.dropAll();
      liquibase.update("form");
    } else if (FormEngineConfiguration.DB_SCHEMA_UPDATE_TRUE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Updating schema FORM");
      liquibase.update("form");
    } else if (FormEngineConfiguration.DB_SCHEMA_UPDATE_FALSE.equals(databaseSchemaUpdate)) {
      LOGGER.debug("Validating schema FORM");
      liquibase.validate();
    }
  } catch (Exception e) {
    throw new FlowableException("Error initialising form data schema", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-dmn-engine

@Override
public void schemaDrop() {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(CommandContextUtil.getDmnEngineConfiguration());
    liquibase.dropAll();
  } catch (Exception e) {
    throw new FlowableException("Error dropping DMN engine tables", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-content-engine

@Override
public void schemaDrop() {
  Liquibase liquibase = createLiquibaseInstance(CommandContextUtil.getContentEngineConfiguration());
  try {
    liquibase.dropAll();
  } catch (Exception e) {
    throw new FlowableException("Error dropping content engine tables", e);
  } finally {
    closeDatabase(liquibase);
  }
}

代码示例来源:origin: org.flowable/flowable-app-engine

@Override
public void schemaDrop() {
  Liquibase liquibase = null;
  try {
    liquibase = createLiquibaseInstance(CommandContextUtil.getAppEngineConfiguration());
    liquibase.dropAll();
  } catch (Exception e) {
    LOGGER.info("Error dropping App engine tables", e);
  } finally {
    closeDatabase(liquibase);
  }
  
  try {
    getVariableSchemaManager().schemaDrop();
  } catch (Exception e) {
    LOGGER.info("Error dropping variable tables", e);
  }
  
  try {
    getIdentityLinkSchemaManager().schemaDrop();
  } catch (Exception e) {
    LOGGER.info("Error dropping identity link tables", e);
  }
  
  try {
    getCommonSchemaManager().schemaDrop();
  } catch (Exception e) {
    LOGGER.info("Error dropping common tables", e);
  }
}

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

@Override
protected void doUpdate(Liquibase liquibase) throws LiquibaseException {
  if (dropFirst) {
   liquibase.dropAll();
  }
 if (changesToApply > 0) {
  liquibase.update(changesToApply, new Contexts(contexts), new LabelExpression(labels));
 } else {
  liquibase.update(toTag, new Contexts(contexts), new LabelExpression(labels));
 }
}

代码示例来源:origin: io.choerodon/choerodon-liquibase

liquibase.dropAll();

代码示例来源:origin: choerodon/choerodon-starters

liquibase.dropAll();

代码示例来源:origin: org.flowable/flowable-content-engine

public static void main(String[] args) {
    try {
      ContentEngine contentEngine = ContentEngines.getDefaultContentEngine();
      DataSource dataSource = contentEngine.getContentEngineConfiguration().getDataSource();

      DatabaseConnection connection = new JdbcConnection(dataSource.getConnection());
      Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection);
      database.setDatabaseChangeLogTableName(ContentEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogTableName());
      database.setDatabaseChangeLogLockTableName(ContentEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogLockTableName());

      if (StringUtils.isNotEmpty(contentEngine.getContentEngineConfiguration().getDatabaseSchema())) {
        database.setDefaultSchemaName(contentEngine.getContentEngineConfiguration().getDatabaseSchema());
        database.setLiquibaseSchemaName(contentEngine.getContentEngineConfiguration().getDatabaseSchema());
      }

      if (StringUtils.isNotEmpty(contentEngine.getContentEngineConfiguration().getDatabaseCatalog())) {
        database.setDefaultCatalogName(contentEngine.getContentEngineConfiguration().getDatabaseCatalog());
        database.setLiquibaseCatalogName(contentEngine.getContentEngineConfiguration().getDatabaseCatalog());
      }

      Liquibase liquibase = new Liquibase("org/flowable/content/db/liquibase/flowable-content-db-changelog.xml", new ClassLoaderResourceAccessor(), database);
      liquibase.dropAll();
      liquibase.getDatabase().close();

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

代码示例来源:origin: org.flowable/flowable-dmn-engine

public static void main(String[] args) {
    try {
      DmnEngine dmnEngine = DmnEngines.getDefaultDmnEngine();
      DataSource dataSource = dmnEngine.getDmnEngineConfiguration().getDataSource();

      DatabaseConnection connection = new JdbcConnection(dataSource.getConnection());
      Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection);
      database.setDatabaseChangeLogTableName(DmnEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogTableName());
      database.setDatabaseChangeLogLockTableName(DmnEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogLockTableName());

      if (StringUtils.isNotEmpty(dmnEngine.getDmnEngineConfiguration().getDatabaseSchema())) {
        database.setDefaultSchemaName(dmnEngine.getDmnEngineConfiguration().getDatabaseSchema());
        database.setLiquibaseSchemaName(dmnEngine.getDmnEngineConfiguration().getDatabaseSchema());
      }

      if (StringUtils.isNotEmpty(dmnEngine.getDmnEngineConfiguration().getDatabaseCatalog())) {
        database.setDefaultCatalogName(dmnEngine.getDmnEngineConfiguration().getDatabaseCatalog());
        database.setLiquibaseCatalogName(dmnEngine.getDmnEngineConfiguration().getDatabaseCatalog());
      }

      Liquibase liquibase = new Liquibase("org/flowable/dmn/db/liquibase/flowable-dmn-db-changelog.xml", new ClassLoaderResourceAccessor(), database);
      liquibase.dropAll();
      liquibase.getDatabase().close();

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

代码示例来源:origin: org.flowable/flowable-form-engine

public static void main(String[] args) {
    try {
      FormEngine formEngine = FormEngines.getDefaultFormEngine();
      DataSource dataSource = formEngine.getFormEngineConfiguration().getDataSource();

      DatabaseConnection connection = new JdbcConnection(dataSource.getConnection());
      Database database = DatabaseFactory.getInstance().findCorrectDatabaseImplementation(connection);
      database.setDatabaseChangeLogTableName(FormEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogTableName());
      database.setDatabaseChangeLogLockTableName(FormEngineConfiguration.LIQUIBASE_CHANGELOG_PREFIX + database.getDatabaseChangeLogLockTableName());

      if (StringUtils.isNotEmpty(formEngine.getFormEngineConfiguration().getDatabaseSchema())) {
        database.setDefaultSchemaName(formEngine.getFormEngineConfiguration().getDatabaseSchema());
        database.setLiquibaseSchemaName(formEngine.getFormEngineConfiguration().getDatabaseSchema());
      }

      if (StringUtils.isNotEmpty(formEngine.getFormEngineConfiguration().getDatabaseCatalog())) {
        database.setDefaultCatalogName(formEngine.getFormEngineConfiguration().getDatabaseCatalog());
        database.setLiquibaseCatalogName(formEngine.getFormEngineConfiguration().getDatabaseCatalog());
      }

      Liquibase liquibase = new Liquibase("org/flowable/form/db/liquibase/flowable-form-db-changelog.xml", new ClassLoaderResourceAccessor(), database);
      liquibase.dropAll();
      liquibase.getDatabase().close();

    } catch (Exception e) {
      e.printStackTrace();
    }
  }
}

相关文章