Chapter 3 Building Physical Diagrams
Automatic reuse and migration of columns
When you create a reference, PowerDesigner can automatically:
- Reuse an appropriate existing column in the child table as the foreign key column
- Migrate the primary key column in the parent table to create a foreign key column in the child table
To auto-reuse and/or auto-migrate columns:
- Select Tools→Model Options to open the Model Options dialog box.
or
Right-click the diagram background and select Model Options from the contextual menu.
- Select the Reference sub-category in the left-hand Category pane to display the Reference page.
- Specify your choices for column reuse and migration as follows:
- To auto-reuse existing columns in child tables as foreign key columns when creating references , select the Auto-reuse columns check box. Note that the column in the child table must have the same code as the migrating primary key column, and cannot already be a foreign key column for it to be suitable for reuse. If you want to reuse a child table column that is already a foreign key column, you must do this manually from the Joins page of the reference property sheet.
- To auto-migrate primary key columns in parent tables for use as foreign key columns in child tables , select the Auto-migrate columns check box. This will also enable the column properties check boxes, allowing you to specify which of the parent column properties to migrate.
- To auto-migrate the properties of parent table primary key columns , select the appropriate check boxes:
- Domains
- Check (check parameters)
- Rules (business rules)
- Last position (migrated columns should be added at the end of the table column list. If the Last position option is not selected, migrated columns are inserted between key columns and other columns which implies that a child table must be dropped and recreated each time you add a reference and modify an existing database.)
Note that, during intermodel generation, whether or not the Auto-migrate columns check box is selected, any selected column property is migrated from the PK to the FK.
- Ensure that the Default link on creation option is set to Primary key.
- Click OK to close the Model Options dialog box.
Copyright (C) 2005. Sybase Inc. All rights reserved.
|
|