Quantcast
Channel: Liquibase Forums
Viewing all articles
Browse latest Browse all 2993

Change to primaryKeyExists precondition

$
0
0
In liquibase 3.4.2, this worked:

- changeSet:
    id: 1450270295661-5
    author: blah
    preConditions:
        onFail: MARK_RAN
        not:
            primaryKeyExists:
                primaryKeyName: data_pkey
    changes:
    - addPrimaryKey:
        columnNames: id, type
        constraintName: data_pkey
        tableName: data

In liquibase 3.5.3, it must look like this:
- changeSet:
    id: 1450270295661-5
    author: blah
    preConditions:
        onFail: MARK_RAN
        not:
            primaryKeyExists:
                primaryKeyName: data_pkey
                tableName: data
    changes:
    - addPrimaryKey:
        columnNames: id, type
        constraintName: data_pkey
        tableName: data

Or I get an exception:  liquibase.exception.DatabaseException: java.sql.SQLException: Invalid argument in JDBC call: table: null

The change is easy enough to make, but a change to a changeset changes the checksum, which will break all future releases of my product, right? Is there some workaround to this?

Viewing all articles
Browse latest Browse all 2993

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>