Uploaded image for project: 'DdlUtils'
  1. DdlUtils
  2. DDLUTILS-75

Add support for "On Delete" and "On Update" in schema XML for foreign keys

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • 1.1
    • None
    • Oracle 10g Express Edition
      Windows XP
      Java 1.5.0
      Ant 1.6.5

    Description

      Currently, when dumping the schema from a live database to XML, the 'on delete' and 'on update' rules for foreign keys are ignored. As shown in the DTD for database.dtd (below), the attributes onDelete and onUpdate should translate into "on delete cascade" for example in the target SQL.

      <!ELEMENT foreign-key (reference+)>
      <!ATTLIST foreign-key
      foreignTable CDATA #REQUIRED
      name CDATA #IMPLIED
      onUpdate (cascade|setnull|restrict|none) "none"
      onDelete (cascade|setnull|restrict|none) "none"
      >

      If the dump (DatabaseToDdl) is modified to write these attributes out, then the schema load (DdlToDatabase) needs to handle them and set the correct behavior on the foreign key creation.

      Attachments

        1. delete_cascade.patch
          12 kB
          Guy Davis
        2. delete_cascade2.patch
          18 kB
          Ate Douma

        Issue Links

          Activity

            People

              tomdz Thomas Dudziak
              guy_davis Guy Davis
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: