gpt4 book ai didi

liquibase - 运行 Liquibase : ERROR: relation "databasechangelog" does not exist 时出现意外错误

转载 作者:行者123 更新时间:2023-12-01 06:03:54 26 4
gpt4 key购买 nike

针对新的 postgres 数据库运行 liquibase(版本 3.5.3)部署时,我们收到以下错误。表databasechangelog 不是由liquibase 创建的,但是表databasechangeloglock 确实被创建了。

INFO 2/7/17 1:27 PM: liquibase: Successfully acquired change log lock
INFO 2/7/17 1:27 PM: liquibase: Successfully released change log lock
Unexpected error running Liquibase: ERROR: relation "audit.databasechangelog" does not exist
Position: 20

SEVERE 2/7/17 1:27 PM: liquibase: ERROR: relation "audit.databasechangelog" does
not exist
Position: 20
liquibase.exception.DatabaseException: Error executing SQL SELECT MD5SUM FROM au
dit.databasechangelog WHERE MD5SUM IS NOT NULL LIMIT 1: ERROR: relation "audit.d
atabasechangelog" does not exist
Position: 20
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:68)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:126)
at liquibase.executor.jvm.JdbcExecutor.query(JdbcExecutor.java:134)
at liquibase.executor.jvm.JdbcExecutor.queryForList(JdbcExecutor.java:20
0)
at liquibase.executor.jvm.JdbcExecutor.queryForList(JdbcExecutor.java:19
4)
at liquibase.changelog.StandardChangeLogHistoryService.init(StandardChan
geLogHistoryService.java:212)
at liquibase.Liquibase.checkLiquibaseTables(Liquibase.java:1124)
at liquibase.Liquibase.update(Liquibase.java:205)
at liquibase.Liquibase.update(Liquibase.java:192)
at liquibase.integration.commandline.Main.doMigration(Main.java:1130)
at liquibase.integration.commandline.Main.run(Main.java:188)
at liquibase.integration.commandline.Main.main(Main.java:103)
Caused by: org.postgresql.util.PSQLException: ERROR: relation "audit.databasecha
ngelog" does not exist
Position: 20
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryEx
ecutorImpl.java:2455)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutor
Impl.java:2155)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.ja
va:288)
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:430)

at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:356)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:303
)
at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:289
)
at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:266
)
at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:233)
at liquibase.executor.jvm.JdbcExecutor$QueryStatementCallback.doInStatem
ent(JdbcExecutor.java:345)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:55)
... 11 more

有两种模式,ods 和审计。 search_path 是 ods、audit、public。我们在连接字符串中指定目标模式 (currentSchema=audit)。此外,我们针对 ods 模式成功运行。
作为一种解决方法,我们可以手动创建日志表。但是,我想知道这是 liquibase 的错误还是我们做错了什么?我的想法是 liquibase 以某种方式看到 ods.databasechangelog 并跳过创建它。

任何想法将不胜感激。

最佳答案

也许尝试使用以下 liquibase 参数:--defaultSchemaName=<schema>

关于liquibase - 运行 Liquibase : ERROR: relation "databasechangelog" does not exist 时出现意外错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42098358/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com