# Relations

Relation between tables are enforced with primary and foreign keys, with cascade actions where appropriate.&#x20;

The exception are action and check tables, where we had to "detach" logger tables from config tables in order to import logger into central repository without also importing config tables. Configuration tables are defined for a local scope only and for that reason the `sql_instance` is not part of the primary key.

In this instance, cascade actions are handled by triggers:

![](https://560149426-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LamHUpIpVXoBUUDZZpO%2F-LtzlK4iGS3oze8E2gYk%2F-Lu7sqamLr7q72yS26yD%2Fimage.png?alt=media\&token=5bc26b3c-1fd5-42e0-bbfe-4bfb8834f44b)

## Entity Relationship Diagram

![SQLWATCH 2.3 ERD](https://560149426-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LamHUpIpVXoBUUDZZpO%2F-M5Z6qHpbsWh_cfesMRM%2F-M5Z7flUidcNYyg2UwnY%2FSQLWATCH_2.3.png?alt=media\&token=e37c153e-1390-4fe9-8313-e2d7fb1558a1)
