[ http://issues.apache.org/jira/browse/DDLUTILS-89?page=comments#action_12374280 ] Jun Li commented on DDLUTILS-89: -------------------------------- I found this issue also, and the fix I made locally was modify the readForeignKeys method in the JdbcModelReader class. Used Map fks = new TreeMap() instead of Map fks = new ListOrderMap(); > Lack of ordering for foreign keys in WriteSchemaToFile results in spurious diffs > -------------------------------------------------------------------------------- > > Key: DDLUTILS-89 > URL: http://issues.apache.org/jira/browse/DDLUTILS-89 > Project: DdlUtils > Type: Improvement > Environment: Oracle 10g EE > SQLServer 2005 EE > Windows XP SP2 > Java 1.5.0_06 > Reporter: Guy Davis > Assignee: Thomas Dudziak > Attachments: order_fks.patch > > We use the WriteSchemaToFile task to store our applications schema in a file we place in our Subversion CM tool. Every time we run this task, it reorders the foreign keys on a table. So, for example, if Table A has FKs X, Y, Z then schema.xml file alternates between: >