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

Generated duplicate constraint names

$
0
0
We have many entities in our system with similar names.  When I use the hibernate plugin to generate an initial schema (using the diffDatabaseToChangeLog command) I get duplicate constraint names.  For instance, given entities ChargeHeader and ChargeHeaderSent I get this:

<changeSet author="foobar(generated)" id="1404858920815-630">
      <addPrimaryKey columnNames="id" constraintName="CHARGE_HEADERPK" tableName="CHARGE_HEADER"/>
</changeSet>

<changeSet author="foobar(generated)" id="1404858920815-631">
      <addPrimaryKey columnNames="id" constraintName="CHARGE_HEADERPK" tableName="CHARGE_HEADER_SENT"/>
</changeSet>


Obviously this fails when I try to update the database with these changesets (ORA-02264: name already used by an existing constraint).  I also wonder why there is no flag for the column tag that would indicate which column is a primary key, rather than having all these addPrimaryKey tags.  That would avoid this duplicate name problem entirely.

Thanks,
Larry Kline


Viewing all articles
Browse latest Browse all 2993

Trending Articles



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