Liquibase:defaultSchemaName不起作用

时间:2019-01-28 08:42:09

标签: sql gradle liquibase

鉴于此gradle配置,我正在尝试执行liquibase update

apply plugin: 'liquibase'

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'org.liquibase:liquibase-core:3.5.3'
        classpath "org.liquibase:liquibase-gradle-plugin:1.2.4"
        classpath 'org.postgresql:postgresql:42.2.2'
    }
}

def dbUrl = 'jdbc:postgresql://localhost:5432/my_db'
def dbUserName = System.getenv('DB_USER_NAME')
def dbUserPass = System.getenv('DB_USER_PASSWORD')

task('build_test') {
    doLast {
        println "Building test..."
        liquibase {
            activities {
                main {
                    changeLogFile "$projectDir/com/pany/db/changelog/master.xml"
                    url dbUrl
                    username dbUserName
                    password dbUserPass
                    defaultSchemaName 'my_test_schema'
                    update
                }
            }
        }
    }
}

它已成功执行,但是问题是所有表都是在公共模式下创建的,除了liquibase为满足其需要而创建的那两个表(databasechangelog和databasechangeloglock)。

那么如何告诉liquibase在另一个模式中创建表?

0 个答案:

没有答案