org.flywaydb.core.Flyway.getTable()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(86)

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

Flyway.getTable介绍

暂无

代码示例

代码示例来源:origin: ch.inftec.flyway/flyway-extension-core

/**
 * delete all scripts from metadata table which has been registered as CUSTOM
 *
 * @param connection
 */
@Override
public void beforeMigrate(Connection connection) {
  try {
    DbSupport dbSupport = DbSupportFactory.createDbSupport(connection, false);
    if (!dbSupport.getCurrentSchema().getTable(flyway.getTable()).exists()) {
      return;
    }
    String sql = "DELETE FROM " + flyway.getTable()
        + " WHERE " + dbSupport.quote("type") + "='CUSTOM'";
    connection.createStatement().execute(sql);
  } catch (SQLException e) {
    LOG.error(e.getMessage(), e);
  }
}

代码示例来源:origin: icode/ameba

boolean hasTable;
try (Connection connection = flyway.getDataSource().getConnection()) {
  hasTable = connection.getMetaData().getTables(null, null, flyway.getTable(), null).next();
} catch (SQLException e) {
  throw new AmebaException(e);

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

if (!tableExists(connection, flyway.getTable(), true)) {
  System.out
    .println("\nNOTE: This database is NOT yet initialized for auto-migrations (via Flyway).");

代码示例来源:origin: org.leapframework/jmms-engine

void migrate(OrmContext oc) {
  Flyway flyway = createFlyway(oc);
  if(null != flyway) {
    if(!oc.getDb().checkTableExists(flyway.getTable())) {
      flyway.baseline();
    }
    flyway.migrate();
  }
}

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

if (!tableExists(connection, flyway.getTable(), true)) {

代码示例来源:origin: ch.inftec.flyway/flyway-extension-core

String sql = "DELETE FROM " + flyway.getTable()
    + " WHERE " + dbSupport.quote("type") + "='CUSTOM'";
connection.createStatement().execute(sql);

代码示例来源:origin: ch.inftec.flyway/flyway-extension-core

DbSupport dbSupport = DbSupportFactory.createDbSupport(connection, false);
JdbcTemplate jdbcTemplate = dbSupport.getJdbcTemplate();
jdbcTemplate.update("INSERT INTO " + flyway.getTable()
    + " (" + dbSupport.quote("version_rank")
    + "," + dbSupport.quote("installed_rank")

相关文章