Chapter 3 Building Physical Diagrams


Setting Model Options for References

To set model options for references, select Tools→Model Options, and select the Reference sub-category in the left-hand Category pane.


You can set the following options on this page:

Option Function
Unique code Requires that references have unique codes. If this option is not selected then different references can have the same code (except when two references share the same child table).
Auto-reuse columns Enables the reuse of columns in a child table as foreign key columns if the following conditions are satisfied:

  • Child column has same code as migrating primary key column
  • Child column is not already a foreign key column
  • Data types are compatible


For more information, see "Automatic reuse and migration of columns ".
Auto-migrate columns Enables the automatic migration of primary key columns from the parent table as foreign key columns to the child table. If you select both Auto-migrate columns and any of the following sub-options, then the relevant column property of the PK will also be migrated to the FK at reference creation:

  • Domain
  • Check
  • Rules
  • Last position


For more information, see "Automatic reuse and migration of columns ".
Mandatory parent Specifies that the relationship between child and parent tables is, by default, mandatory, i.e., each foreign key value in the child table must have a corresponding key value, in the parent table.
Change parent allowed Specifies that a foreign key value can change to select another value in the referenced key in the parent table.
Check on commit Specifies that referential integrity is checked only on commit, rather than immediately after row insertion. This feature can be useful when working with circular dependencies. Not available with all DBMSs.
Propagate column properties Propagates changes made to the name, code, or data type of a parent table column to the corresponding child column.
Default link on creation Specifies how reference links are created. You can select either:

  • Primary key – automatically create links from primary key to foreign key columns at creation
  • User-defined – manually create your own links
Default implementation Specifies how referential integrity is implemented in the reference. You can select either:

  • Declarative – referential integrity is defined by constraint in foreign declarations
  • Trigger – referential integrity is implemented by triggers


For more information on referential integrity, see "Using referential integrity".
Default Constraints: Update Controls how updating a key value in the parent table will, by default, affect the foreign key value in the child table. Depending on your DBMS, you can choose from some or all of the following settings:

  • None – no effect
  • Restrict – cannot update parent value if one or more matching child values exist (no effect)
  • Cascade - update matching child values
  • Set null - set matching child values to NULL
  • Set default – set matching child values to default value
Default Constraints: Delete Controls how deleting a key value in the parent table will, by default, affect the foreign key value in the child table. Depending on your DBMS, you can choose from some or all of the following settings:

  • None – no effect
  • Restrict – cannot delete parent value if one or more matching child values exist (no effect)
  • Cascade - delete matching child values
  • Set null - set matching child values to NULL
  • Set default – set matching child values to default value

 


Copyright (C) 2005. Sybase Inc. All rights reserved.