11 Foreign Key Constraints
Constraint Name | Child Column | Parent Column | Delete Rule | ||
---|---|---|---|---|---|
facilities_connection_state_id_fkey |
|
|
Restrict delete | ||
facilities_organization_id_fkey |
|
|
Cascade on delete | ||
device_managers_facility_id_fkey |
|
|
Restrict delete | ||
devices_facility_id_fkey |
|
|
Cascade on delete | ||
devices_parent_id_fkey |
|
|
Restrict delete | ||
timeseries_values_timeseries_id_fkey |
|
|
Cascade on delete | ||
device_templates_category_id_fkey |
|
|
Restrict delete | ||
automations_device_id_fkey |
|
|
Cascade on delete | ||
automations_facility_id_fkey |
|
|
Cascade on delete | ||
timeseries_type_id_fkey |
|
|
Restrict delete | ||
timeseries_device_id_fkey |
|
|
Cascade on delete |
Check Constraints
Table | Constraint Name | Constraint |
---|---|---|
facilities | facilities_description_check | ((description !~ similar_to_escape(' *'::text))) |
organizations | country_code_matches_subdivision | (((country_subdivision_code IS NULL) OR (substr(country_subdivision_code, 1, 2) = country_code))) |
organizations | organizations_country_code_check | ((country_code !~ similar_to_escape(' *'::text))) |
organizations | organizations_country_subdivision_code_check | ((country_subdivision_code !~ similar_to_escape(' *'::text))) |
organizations | organizations_description_check | ((description !~ similar_to_escape(' *'::text))) |
organizations | other_type_details_null_or_not_empty | (((organization_type_details IS NULL) OR ((organization_type_details)::text <> ''::text))) |
organizations | other_type_details_only_for_other | ((((organization_type_details IS NULL) AND (organization_type_id <> 6)) OR ((organization_type_details IS NOT NULL) AND (organization_type_id = 6)))) |
device_managers | device_managers_user_iff_facility | ((((user_id IS NOT NULL) AND (facility_id IS NOT NULL)) OR ((user_id IS NULL) AND (facility_id IS NULL)))) |
devices | devices_address_check | ((address !~ similar_to_escape(' *'::text))) |
devices | devices_protocol_check | ((protocol !~ similar_to_escape(' *'::text))) |
device_templates | device_templates_address_check | ((address !~ similar_to_escape(' *'::text))) |
device_templates | device_templates_description_check | ((description !~ similar_to_escape(' *'::text))) |
device_templates | device_templates_protocol_check | ((protocol !~ similar_to_escape(' *'::text))) |
automations | automations_description_check | ((description !~ similar_to_escape(' *'::text))) |
automations | automations_timeseries_name_check | ((timeseries_name !~ similar_to_escape(' *'::text))) |
timeseries | timeseries_decimal_places_check | ((decimal_places >= 0)) |
timeseries | timeseries_units_check | ((units !~ similar_to_escape(' *'::text))) |