I wonder if this is related to carcarlo's message "Diff finds foreign key
differences on two indentical MySQL databases".
I'm not sure if this matters, but I was using Oracle.
Rick
________________________________
I tried to add a couple of new columns with one column as a foreign key to
another table and it didn't create the FK constraint. Am I don't something
wrong or is this a bug?
Rick Cromer
Here's the XML for the change set.
<changeSet id="182" author="cruml">
<addColumn tableName="DID_LOT">
<column name="VENDOR_ID" type="NUMBER(10)" >
<constraints nullable="true" foreignKeyName="DID_LOT_VENDOR_FK"
references="VENDOR(ID)" />
</column>
<column name="LOAD_DATE" type="date" defaultValueDate="SYSDATE" >
<constraints nullable="false"/>
</column>
</addColumn>
</changeSet>
When I run updateSQL or update the creation of the foreign key is not made.
Here's the updateSQL output below:
-- Ran at: 5/22/09 10:50 AM
-- Against: po...@jdbc:oracle:thin:@loghost:1521:ENTICE
-- LiquiBase version: 1.9.1
-- *********************************************************************
SELECT COUNT(*) FROM DATABASECHANGELOGLOCK WHERE ID=1;
SELECT COUNT(*) FROM DATABASECHANGELOGLOCK WHERE ID=1;
-- Changeset post3Schema.xml::182::cruml::(MD5Sum:
fedff0f6941fcc8c1866949687d3fb43)
-- Add new columns to the DID_LOT table
ALTER TABLE DID_LOT ADD VENDOR_ID NUMBER(10);
ALTER TABLE DID_LOT ADD LOAD_DATE DATE DEFAULT SYSDATE NOT NULL;
INSERT INTO DATABASECHANGELOG (DATEEXECUTED, AUTHOR, LIQUIBASE, DESCRIPTION,
COMMENTS, MD5SUM, ID, FILENAME) VALUES (SYSDATE, 'cruml', '1.9.1', 'Add
Column', 'Add new columns to the DID_LOT table',
'fedff0f6941fcc8c1866949687d3fb43', '182', 'post3Schema.xml');
-- Release Database Lock
UPDATE DATABASECHANGELOGLOCK SET LOCKEDBY = NULL, LOCKGRANTED = NULL, LOCKED =
0 WHERE ID = 1;
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user