liquibase-plugin 错误 - 迁移失败

liquibase-plugin error - migration failed

我无法启动我的 Java 应用程序

liqibase更新错误:

[ERROR] Failed to execute goal org.liquibase:liquibase-maven-plugin:3.5.1:update (default-cli) on project api-manager: Error setting up or running Liquibase: Migration failed for change set db/changelog/1.0/1.0-init-tables.xml::1.0-init-tables::api-manager:
[ERROR] Reason: liquibase.exception.DatabaseException: ERROR: relation "service" does not exist [Failed SQL ..... so on ... so on

pom 片段

    <dependency>
        <groupId>org.liquibase</groupId>
        <artifactId>liquibase-core</artifactId>
        <scope>runtime</scope>
    </dependency>

        <plugin>
            <groupId>org.liquibase</groupId>
            <artifactId>liquibase-maven-plugin</artifactId>
            <version>${liquibase-maven-plugin.version}</version>
            <configuration>
                <changeLogFile>db/changelog/db.changelog-master.xml</changeLogFile>
                <driver>${manager.db.driver}</driver>
                <url>${manager.db.url}</url>
                <username>${manager.db.user}</username>
                <password>${manager.db.password}</password>
                <verbose>false</verbose>
                <logging>info</logging>
                <contexts>${manager.db.contexts}</contexts>
                <promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
            </configuration>
        </plugin>

db.changelog-master.xml 在 resources/db/changelog/db.changelog-master.xml 中:

<?xml version="1.0" encoding="UTF-8"?>

<databaseChangeLog
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">

    <include file="db/changelog/1.0/1.0-init-tables.xml"/>

</databaseChangeLog>

1.0-init-tables.xml 在 resources/db/changelog/1.0/1.0-init-tables.xml :

<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">

    <changeSet id="1.0-init-tables" author="api-manager">
          HERE ARE MINE <CREATE TABLES>
    </changeSet>
</databaseChangeLog>

如果需要 sql 错误日志,请告诉我,然后我将编辑此 post。

如果有人出现类似错误,请检查您的表格是否为小写 - 是的 Postgres 不喜欢大写... 这些更改解决了我的问题