com.googlecode.flyway.core.Flyway.setSchemas()方法的使用及代码示例

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

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

Flyway.setSchemas介绍

[英]Sets the schemas managed by Flyway. These schema names are case-sensitive. (default: The default schema for the datasource connection)

Consequences:

  • The first schema in the list will be automatically set as the default one during the migration.
  • The first schema in the list will also be the one containing the metadata table.
  • The schemas will be cleaned in the order of this list.
    [中]设置Flyway管理的架构。这些架构名称区分大小写。(默认:数据源连接的默认架构)
    后果:
    *迁移期间,列表中的第一个架构将自动设置为默认架构。
    *列表中的第一个模式也将是包含元数据表的模式。
    *架构将按照此列表的顺序进行清理。

代码示例

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

public MigrationsPlugin(Flyway flyway) {
  this.flyway = flyway;
  this.flyway.setInitOnMigrate(true);
  this.flyway.setSchemas("PUBLIC");
}

代码示例来源:origin: SAP/olingo-jpa-processor-v4

flyway.setSchemas(DB_SCHEMA);
flyway.migrate();
return ds;

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

public void init(Application<? extends ApplicationConfiguration> application) {
  DatabaseConfiguration dbConfig = application.getConfiguration().getDatabaseConfiguration();
  
  URI uri = getUri(dbConfig.getUrl());
  if (Strings.isNullOrEmpty(uri.getPath())) {
    flyway.setDataSource(dbConfig.getUrl(), dbConfig.getUsername(), dbConfig.getPassword());
  } else {
    flyway.setDataSource(getUrl(uri, false), dbConfig.getUsername(), dbConfig.getPassword());
    flyway.setSchemas(uri.getPath().substring(1));
  }
  flyway.migrate();
}

代码示例来源:origin: com.googlecode.flyway/flyway-core

setSchemas(StringUtils.tokenizeToStringArray(schemasProp, ","));

代码示例来源:origin: com.googlecode.flyway/flyway-ant

String schemasValue = useValueIfPropertyNotSet(schemas, "schemas");
if (schemasValue != null) {
  flyway.setSchemas(StringUtils.tokenizeToStringArray(schemasValue, ","));

代码示例来源:origin: com.googlecode.flyway/flyway-core

" Set a default schema for the connection or specify one using the schemas property!");
setSchemas(currentSchema.getName());

相关文章