db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jun Li" <allanju...@gmail.com>
Subject How does the xml sorted for foreign-key?
Date Tue, 04 Apr 2006 05:57:43 GMT
I found that foreign-keys (reference to a same table) doesn't generated in a
particular order.

For example, schema 1:

    <table name="EmployeeTypeCodingFieldMap">
      <column name="EmployeeTypeCodingFieldMapID" primaryKey="true"
required="true" type="NUMERIC" size="8" autoIncrement="true"/>
      <column name="EmployeeTypeFK" primaryKey="false" required="true"
type="NUMERIC" size="8" autoIncrement="false"/>
      <column name="CodingFieldFK" primaryKey="false" required="true"
type="NUMERIC" size="8" autoIncrement="false"/>
      <column name="IsCompulsory" primaryKey="false" required="true"
type="CHAR" size="1" default="Y" autoIncrement="false"/>
      <column name="SortOrder" primaryKey="false" required="true"
type="NUMERIC" size="8" autoIncrement="false"/>
      <column name="ImpliedByCodingFieldFK" primaryKey="false"
required="false" type="NUMERIC" size="8" autoIncrement="false"/>
      <foreign-key foreignTable="CodingField"
name="FK_EmpTypeCodngFldMap_CodngFld">
        <reference local="CodingFieldFK" foreign="CodingFieldID"/>
      </foreign-key>
      <foreign-key foreignTable="CodingField"
name="FK_EmpTypeCFM_ImpByCodingField">
        <reference local="ImpliedByCodingFieldFK" foreign="CodingFieldID"/>
      </foreign-key>
      <foreign-key foreignTable="EmployeeType"
name="FK_EmpTypeCodngFldMap_EmpType">
        <reference local="EmployeeTypeFK" foreign="EmployeeTypeID"/>
      </foreign-key>
      <unique name="PK_EmployeeTypeGLCodeTypeMap">
        <unique-column name="EmployeeTypeCodingFieldMapID"/>
      </unique>
      <index name="IX_EmpTpCodngFldMp_ImpCodngFld">
        <index-column name="ImpliedByCodingFieldFK"/>
      </index>
      <index name="IX_EmpTypeCodingFldMap_EmpType">
        <index-column name="EmployeeTypeFK"/>
      </index>
      <index name="IX_EmpTypeCodngFldMap_CodngFld">
        <index-column name="CodingFieldFK"/>
      </index>
    </table>

schema 2:

    <table name="EmployeeTypeCodingFieldMap">
      <column name="EmployeeTypeCodingFieldMapID" primaryKey="true"
required="true" type="NUMERIC" size="8" autoIncrement="true"/>
      <column name="EmployeeTypeFK" primaryKey="false" required="true"
type="NUMERIC" size="8" autoIncrement="false"/>
      <column name="CodingFieldFK" primaryKey="false" required="true"
type="NUMERIC" size="8" autoIncrement="false"/>
      <column name="IsCompulsory" primaryKey="false" required="true"
type="CHAR" size="1" default="Y" autoIncrement="false"/>
      <column name="SortOrder" primaryKey="false" required="true"
type="NUMERIC" size="8" autoIncrement="false"/>
      <column name="ImpliedByCodingFieldFK" primaryKey="false"
required="false" type="NUMERIC" size="8" autoIncrement="false"/>
      <foreign-key foreignTable="CodingField"
name="FK_EmpTypeCFM_ImpByCodingField">
        <reference local="ImpliedByCodingFieldFK" foreign="CodingFieldID"/>
      </foreign-key>
      <foreign-key foreignTable="CodingField"
name="FK_EmpTypeCodngFldMap_CodngFld">
        <reference local="CodingFieldFK" foreign="CodingFieldID"/>
      </foreign-key>
      <foreign-key foreignTable="EmployeeType"
name="FK_EmpTypeCodngFldMap_EmpType">
        <reference local="EmployeeTypeFK" foreign="EmployeeTypeID"/>
      </foreign-key>
      <unique name="PK_EmployeeTypeGLCodeTypeMap">
        <unique-column name="EmployeeTypeCodingFieldMapID"/>
      </unique>
      <index name="IX_EmpTpCodngFldMp_ImpCodngFld">
        <index-column name="ImpliedByCodingFieldFK"/>
      </index>
      <index name="IX_EmpTypeCodingFldMap_EmpType">
        <index-column name="EmployeeTypeFK"/>
      </index>
      <index name="IX_EmpTypeCodngFldMap_CodngFld">
        <index-column name="CodingFieldFK"/>
      </index>
    </table>

schema 1, 2 generated from different DB but the DBs have exactly the same
structure.

And this issue happened on several tables.

Any idea?



--------------
Cheers,
Jun

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message