Primary Key Problem - PostgreSQL - LiquiBase 2.0.1

Update:  I think this may be an h2 limitation.  I can’t seem to create a compound primary key that includes an identity field.  I have posted a question on h2 forums as well.

I used generateChangeLog against a Postgres DB to create a starting point from my existing db.  It created this simple table:

   
       
           
               
           
           
               
           
           
               
           
           
               
           
           
               
           
           
               
           
       
   

Running just that changeset against an new h2 db, liquibase creates a primary key on the agreementId column which is incorrect. 

The primary key should be:

   
       
   

I tried adding primaryKey=“false” to the constraint but that didn’t help.

What can I do to keep liquibase from creating the PK so the changeset that creates the correct PK will succeed.

Thanks in advance for any help.

That changeset looks right, let me know if it doesn’t appear to be an H2 issue


Nathan

The reply I got from the H2 guys wasn’t very specific.  They asked me why I would want to do it in the first place.

It’s in an existing DB that I was trying to create an H2 instance of for dev purposes. 

After looking at how it was actually used, I just dumped the compound PK, created a new PK on the identity field, and a unique constraint on the other fields.

Problem solved.