liquibase 在“create”键上抛出非法参数异常

问题描述 投票:0回答:1

将 liquibase:4.27.0 与以下变更日志/变更集一起使用会引发以下错误...

liquibase.properties

changeLogFile: changelog/changeset.yml
url: jdbc:postgresql://my-postgres-server:5432/my-db
driver: org.postgresql.Driver
classpath: /liquibase/internal/lib/postgresql.jar
defaultSchemaName: my_schema

变更日志/changeset.yml

databaseChangeLog:
  - changeSet:
      id: initial-views
      author: Banana Man
      runOnChange: true
      changes:
        - createView:
          schema_name: my_schema
          path: path/to/my/view.sql
          viewName: my_view
          fullDefinition: true
          replaceIfExists: true

视图.sql

select *
from banana
limit 100;

我想最后我应该补充一点,我是从 liquibase 容器运行这个的

docker run -it -v /file-location:/on-container liquibase bash

我从

liquibase update-sql
得到的错误如下

$liquibase update-sql

...
SET SEARCH_PATH TO my_schema, "$user","public";

ERROR: Exception Details
ERROR: Exception Primary Class: IllegalArgumentException
ERROR: Exception Primary Reason: Key 'create' is not defined
ERROR: Exception Primary Source: PostgreSQL 15.7

Unexpected error running Liquibase: Migration failed for changeset mychangelog.yml::initial-views::Banana Man:
    Reason: java.lang.IllegalArguementException: Key 'create' is not defined
...

我做错了什么?

postgresql liquibase liquibase-sql liquibase-cli
1个回答
0
投票

您不需要在变更集的更改中包含

fullDefinition: true

© www.soinside.com 2019 - 2024. All rights reserved.