You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-dev@db.apache.org by "Guy Davis (JIRA)" <ji...@apache.org> on 2006/04/11 21:03:19 UTC
[jira] Created: (DDLUTILS-89) Lack of ordering for foreign keys in
WriteSchemaToFile results in spurious diffs
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
Assigned to: Thomas Dudziak
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:
<table ...>
<fk name='X' .../>
<fk name='Y' .../>
<fk name='Z' .../>
</table>
AND
<table ...>
<fk name='Z' .../>
<fk name='Y' .../>
<fk name='X' .../>
</table>
Notice, that the keys haven't changed between schema dumps, just the ordering of them in the file. This means tracking version changes is more complicated as a developer's real changes are mixed in with these spurious key position changes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (DDLUTILS-89) Add support for ordering of foreign
keys when reading from a live database
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DDLUTILS-89?page=all ]
Thomas Dudziak updated DDLUTILS-89:
-----------------------------------
Component: Ant Tasks
> Add support for ordering of foreign keys when reading from a live database
> --------------------------------------------------------------------------
>
> Key: DDLUTILS-89
> URL: http://issues.apache.org/jira/browse/DDLUTILS-89
> Project: DdlUtils
> Type: Improvement
> Components: Core (No specific database), Ant Tasks
> Environment: Oracle 10g EE
> SQLServer 2005 EE
> Windows XP SP2
> Java 1.5.0_06
> Reporter: Guy Davis
> Assignee: Thomas Dudziak
> Fix For: 1.0
> 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:
> <table ...>
> <fk name='X' .../>
> <fk name='Y' .../>
> <fk name='Z' .../>
> </table>
> AND
> <table ...>
> <fk name='Z' .../>
> <fk name='Y' .../>
> <fk name='X' .../>
> </table>
> Notice, that the keys haven't changed between schema dumps, just the ordering of them in the file. This means tracking version changes is more complicated as a developer's real changes are mixed in with these spurious key position changes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Commented: (DDLUTILS-89) Lack of ordering for foreign keys
in WriteSchemaToFile results in spurious diffs
Posted by "Jun Li (JIRA)" <ji...@apache.org>.
[ 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:
> <table ...>
> <fk name='X' .../>
> <fk name='Y' .../>
> <fk name='Z' .../>
> </table>
> AND
> <table ...>
> <fk name='Z' .../>
> <fk name='Y' .../>
> <fk name='X' .../>
> </table>
> Notice, that the keys haven't changed between schema dumps, just the ordering of them in the file. This means tracking version changes is more complicated as a developer's real changes are mixed in with these spurious key position changes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (DDLUTILS-89) Add support for ordering of foreign
keys when reading from a live database
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DDLUTILS-89?page=all ]
Thomas Dudziak updated DDLUTILS-89:
-----------------------------------
Fix Version: 1.0
> Add support for ordering of foreign keys when reading from a live database
> --------------------------------------------------------------------------
>
> Key: DDLUTILS-89
> URL: http://issues.apache.org/jira/browse/DDLUTILS-89
> Project: DdlUtils
> Type: Improvement
> Components: Core
> Environment: Oracle 10g EE
> SQLServer 2005 EE
> Windows XP SP2
> Java 1.5.0_06
> Reporter: Guy Davis
> Assignee: Thomas Dudziak
> Fix For: 1.0
> 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:
> <table ...>
> <fk name='X' .../>
> <fk name='Y' .../>
> <fk name='Z' .../>
> </table>
> AND
> <table ...>
> <fk name='Z' .../>
> <fk name='Y' .../>
> <fk name='X' .../>
> </table>
> Notice, that the keys haven't changed between schema dumps, just the ordering of them in the file. This means tracking version changes is more complicated as a developer's real changes are mixed in with these spurious key position changes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (DDLUTILS-89) Add support for ordering of foreign
keys when reading from a live database
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DDLUTILS-89?page=all ]
Thomas Dudziak updated DDLUTILS-89:
-----------------------------------
Summary: Add support for ordering of foreign keys when reading from a live database (was: Lack of ordering for foreign keys in WriteSchemaToFile results in spurious diffs)
Component: Core
DdlUtils uses the order in which the JDBC driver reports the foreign keys. If the driver is not consistent then the resulting output of DdlUtils won't be either. However, a order=desc/asc/none attribute (with asc the default) should help here.
> Add support for ordering of foreign keys when reading from a live database
> --------------------------------------------------------------------------
>
> Key: DDLUTILS-89
> URL: http://issues.apache.org/jira/browse/DDLUTILS-89
> Project: DdlUtils
> Type: Improvement
> Components: Core
> 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:
> <table ...>
> <fk name='X' .../>
> <fk name='Y' .../>
> <fk name='Z' .../>
> </table>
> AND
> <table ...>
> <fk name='Z' .../>
> <fk name='Y' .../>
> <fk name='X' .../>
> </table>
> Notice, that the keys haven't changed between schema dumps, just the ordering of them in the file. This means tracking version changes is more complicated as a developer's real changes are mixed in with these spurious key position changes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Updated: (DDLUTILS-89) Lack of ordering for foreign keys in
WriteSchemaToFile results in spurious diffs
Posted by "Guy Davis (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DDLUTILS-89?page=all ]
Guy Davis updated DDLUTILS-89:
------------------------------
Attachment: order_fks.patch
This patch ensures that foreign keys are kept ordered alphabetically by name rather than the seemingly random order the various JDBC drivers return them in. This means the position of the key in the schema.xml file should remain the same between running WriteSchemaToFile.
> 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:
> <table ...>
> <fk name='X' .../>
> <fk name='Y' .../>
> <fk name='Z' .../>
> </table>
> AND
> <table ...>
> <fk name='Z' .../>
> <fk name='Y' .../>
> <fk name='X' .../>
> </table>
> Notice, that the keys haven't changed between schema dumps, just the ordering of them in the file. This means tracking version changes is more complicated as a developer's real changes are mixed in with these spurious key position changes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (DDLUTILS-89) Add support for ordering of foreign
keys when reading from a live database
Posted by "Thomas Dudziak (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/DDLUTILS-89?page=all ]
Thomas Dudziak resolved DDLUTILS-89.
------------------------------------
Resolution: Fixed
The platform interface has a new property foreignKeysSorted, and the two tasks (DatabaseToDdl, DdlToDatabase) have a related sortForeignKeys attribute, which - when set to true - force the alphabetical sorting of the foreign keys of the tables read from the database. Note that this does not affect the foreign keys of tables read from an XML file.
> Add support for ordering of foreign keys when reading from a live database
> --------------------------------------------------------------------------
>
> Key: DDLUTILS-89
> URL: http://issues.apache.org/jira/browse/DDLUTILS-89
> Project: DdlUtils
> Issue Type: Improvement
> Components: Core (No specific database), Ant Tasks
> Environment: Oracle 10g EE
> SQLServer 2005 EE
> Windows XP SP2
> Java 1.5.0_06
> Reporter: Guy Davis
> Assigned To: Thomas Dudziak
> Fix For: 1.0
>
> 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:
> <table ...>
> <fk name='X' .../>
> <fk name='Y' .../>
> <fk name='Z' .../>
> </table>
> AND
> <table ...>
> <fk name='Z' .../>
> <fk name='Y' .../>
> <fk name='X' .../>
> </table>
> Notice, that the keys haven't changed between schema dumps, just the ordering of them in the file. This means tracking version changes is more complicated as a developer's real changes are mixed in with these spurious key position changes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira