0

Precondition: I am using Liquibase with SQL scripts in my app. I started testing with Oracle DB, but now I need to switch to PostgreSQL DB.

Problem: When I added constraints, I didn't add the names of the constraints. Liquibase changelog contains a script for dropping unique and primary key constraints:

alter table SCENARIO drop primary key/
alter table SCENARIO drop unique (OWNER_ID)/

This syntax doesn't sync with PostgreSQL

Could you give some advice, on how to resolve this problem?

Screenshots: enter image description here

Yakov Stoykov
  • 65
  • 1
  • 1
  • 6
  • 2
    If you want to write vendor independent changelogs, you should use the XML format. `` will work on Postgres and Oracle. –  Nov 01 '22 at 11:18
  • @a_horse_with_no_name, for this command I need to add "constraintName" attribute, but I don't know constraint names. – Yakov Stoykov Nov 01 '22 at 13:36
  • Caused by: liquibase.exception.ValidationFailedException: Validation Failed: 18 changes have validation failures constraintName is required for dropUniqueConstraint on oracle – Yakov Stoykov Nov 01 '22 at 13:51
  • Works for me with Liquibase 4.10 –  Nov 01 '22 at 14:31
  • @a_horse_with_no_name I added a screenshot with the error. I updated the Liquibase version. – Yakov Stoykov Nov 01 '22 at 16:10

0 Answers0