Liquibase Issues

Im new to this liquibase thing and its really causing trouble.

Caused by: liquibase.exception.DatabaseException: ERROR: column “primary_” of relation “address” already exists [Failed SQL: (0) ALTER TABLE public.ADDRESS ADD PRIMARY_ BOOLEAN]

deleted the field from my entity but it seems it doesnot update that changelog.

this keep popping up… I can’t run my application…

I deleted that thing from the xml…

now I get another

ERROR: relation “uc_country_code2” already exists [Failed SQL: (0) ALTER TABLE public.COUNTRY ADD CONSTRAINT UC_COUNTRY_CODE2 UNIQUE (CODE2)]

why is it erroring out on a unique constraint… and saying that it was on the database already. did liquibase not version that? forgot about it and tried to put again and gives an error?

I went to my database and manually REMOVED THAT CONSTRAINT from the database

and I’m getting another one

ERROR: relation “uc_emergency_contact_code” already exists

Can someone please explain why this is happening? and why is this much more complicated than the cuba way of updataing databases?

How can I Get Rid of those liquibase changelogs… I’m making a brand new database… added some fields removed some… and i’ve spent so much time trying to get this thing to run deleting xml lines that are reported as errors. Is there a way to start fresh and have the database sync with my entities without liquibase erroring out and displaying xmls and changelog I don’t care for?

after an hour of trying and tinkering… and tried to delete the files on the changelog/todays date
I’m getting this…

Unexpected error running Liquibase: Validation Failed:
1 change sets check sum
com/company/liquibase/changelog/2021/06/27-010-cc3e2d6a.xml::1::workload was: 8:83ac4d0ed103463e97fb546d1288ca48 but is now: 8:1fd4bafe617ffacd0cd1959ef9a3dcf7

For more information, please use the --logLevel flag
[2021-06-27 00:37:14] SEVERE [liquibase.integration] Unexpected error running Liquibase: Validation Failed:
1 change sets check sum
com/company/liquibase/changelog/2021/06/27-010-cc3e2d6a.xml::1::workload was: 8:83ac4d0ed103463e97fb546d1288ca48 but is now: 8:1fd4bafe617ffacd0cd1959ef9a3dcf7

liquibase.exception.ValidationFailedException: Validation Failed:
1 change sets check sum
com/company/liquibase/changelog/2021/06/27-010-cc3e2d6a.xml::1::workload was: 8:83ac4d0ed103463e97fb546d1288ca48 but is now: 8:1fd4bafe617ffacd0cd1959ef9a3dcf7

at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:299)
at liquibase.Liquibase.lambda$update$1(Liquibase.java:236)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Liquibase.runInScope(Liquibase.java:2322)
at liquibase.Liquibase.update(Liquibase.java:216)
at liquibase.Liquibase.update(Liquibase.java:202)
at liquibase.integration.commandline.Main.doMigration(Main.java:1764)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:364)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.integration.commandline.Main$1.run(Main.java:363)
at liquibase.integration.commandline.Main$1.run(Main.java:193)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:193)
at liquibase.integration.commandline.Main.main(Main.java:156)

I have no idea what this is… application stopped working…
seems like checksum error on newly created file… application hangs…
cant even create my first project…

tried this
gradlew liquibaseClearChecksums
doesent work… honestly I don’t know what im doing… this is way more convoluted and problematic that cuba platform.

I’m still struggling
I deleted my database… I deleted the liquibase folder… tried to create database from scratch to keep working… now I get this.

image

Hi.
Could you please provide more information about your problem? Which version of the platform and Studio plugin do you use? What type of DB do you use in the project?

If it is possible, could you share a small project in order to help us investigate the problem?

Maybe some information from the docs will be useful.

Regards,
Natalia

Hi,
You have this error because the file : liquibase/changelog.xml been deleted.

Regards
Marcin

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

    <property name="uuid.type" dbms="oracle" value="varchar2(32)"/>
    <property name="uuid.type" dbms="!oracle" value="uuid"/>

    <includeAll path="/com/amberline/projects/liquibase/changelog"/>

</databaseChangeLog>
2 Likes