Rebuilding Defaults

You can generate defaults from domains and columns having default values. The Default Rebuild feature uses the default values to create default objects and attaches them to the appropriate domains and/or columns.

Note: When you open a model containing domains with default values and saved in a previous version of PowerDesigner, default objects corresponding to the default values are created in the model.

Default objects are also created when you change the DBMS of a model containing domains with default values, to a DBMS that supports default objects. The opposite process occurs when you switch to a DBMS that does not support default objects: default objects are converted into default values.

You can define a template for the generated default names. This template has the D_%.U:VALUE% value and supports the following variables:

  • DOMAIN for the code of the domain using the default

  • COLUMN for the code of the column using the default

  • TABLE for the code of the table that contains the column with a default

You can define one template for domain defaults and one for column defaults.

  1. Select Tools > Rebuild Objects > Rebuild Defaults to open the Default Rebuild dialog box.
  2. Specify a default name template in the Domain and Column boxes.
  3. [optional] Select the Reuse default with identical value check box – this option will reuse default objects with identical value among columns and domains. If you do not select this option, rebuild creates one default per object.
  4. [optional] Select the Delete and rebuild check box – this option detaches the default objects attached to selected objects and deletes them if they are not used. If you select all objects, this option allows you to clean up the model from all existing defaults and recreate new default objects.
  5. [optional] Click the Selection tab to specify domains and tables for default generation.
  6. Click OK.

    The defaults are automatically created and attached to the domains and/or columns.