Thanks for the report. I'll take a look.
Nathan
From: Animesh Jain [mailto:[email protected]]
Sent: Friday, May 15, 2009 6:29 AM
To: [email protected]
Subject: [Liquibase-user] Diff with hibernate config
Hi
This is a bug I'm facing when diffing my target db against a hibernate
domain model, instead of a DB.
Assume that I have a table1 in target db with a FK named
fk_table1_column1. Now Liquibase is generating addForeignKeyConstraint's
with a randomly generated constraint name, and is not detecting that I
already have such a constraint present. Eg. the following two statements
are getting generated
<changeSet author="user (generated)" id="1242384909234-14">
<addForeignKeyConstraint baseColumnNames="column1"
baseTableName="table1" constraintName="FK5A80D15D488CCCFB"
deferrable="false" initiallyDeferred="false"
referencedColumnNames="column2" referencedTableName="table2"/>
</changeSet>
<changeSet author="user (generated)" id="1242384909234-160">
<dropForeignKeyConstraint baseTableName="table1"
constraintName="fk_table1_column1"/>
</changeSet>
Now even if I do name my foreign key constraint using the hibernate
@ForeignKey attribute to the same name that is already in the target db
(fk_table1_column1) it still generates two change sets, one adding a
foreign key by the name fk_table1_column1 and one deleting
fk_table1_column1. In this case, the first one which is adding the
foreign key contraint will fail because it already exists in the target
db.
Things work fine if I compare between two databases as opposed to
comparing with the hibernate model. I hope I've made myself clear.
Let me know if you cannot reproduce this and I'll send over a test setup
to help out with that. Looking forward to your response.
Cheers
Animesh
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user