Repository Integrity
Repository integrity is managed by creation of foreign keys on a database.
It groups all constraints allowing a check of the impact of modification of a table in tables connected to it.
It could be that the existence of keys in certain DBMSs does not involve a systematic check. It could also be that you wish to customize constraints to be applied on a particular table.
This is why you can generate in triggers the code that corresponds to repository integrity management.
To generate repository integrity of a table:
1. Right-click the database and select Generate triggers.
The trigger generation dialog box opens.
2. Select one of the options offered:
• Generate Trigger by type
• Generate Trigger by repository integrity
3. Select the tables of the database.
4. Click Next.
Triggers are automatically created for the selected tables.
When generation has been completed, the triggers appear under the Trigger folder available under each table. There are three trigger types:
• An update trigger (U_followed by table name), which enables specification of the action to be carried out in case of modification of a line of the table that is part of the foreign key.
• A delete trigger (D_), which specifies the action to be carried out in case of deletion.
• An insert trigger (I_), which specifies the action to be carried out in case of insertion.
These triggers are only valid for a target DBMS. When you change DBMS, you must regenerate the triggers.