xross
xross

Reputation: 648

liquibase-plugin error - migration failed

I have a problem to start my Java app

Error from liqibase update:

[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 fragments

    <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 in 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 in 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>

If the sql error log is required let me know, and then I will edit this post.

Upvotes: 2

Views: 6413

Answers (1)

xross
xross

Reputation: 648

If somebody occures similiar error, please check if your tables are lowercased - yes Postgres doesnt like UpperCases... Those changes fixed my problem

Upvotes: 1

Related Questions