diff --git a/schema/notifications.hcl b/schema/notifications.hcl index 474e0f18..43387f93 100644 --- a/schema/notifications.hcl +++ b/schema/notifications.hcl @@ -269,4 +269,28 @@ table "notification_silences" { type = BRIN columns = [column.until] } + foreign_key "notification_silence_check_id_fkey" { + columns = [column.check_id] + ref_columns = [table.checks.column.id] + on_update = NO_ACTION + on_delete = NO_ACTION + } + foreign_key "notification_silence_config_id_fkey" { + columns = [column.config_id] + ref_columns = [table.config_items.column.id] + on_update = NO_ACTION + on_delete = NO_ACTION + } + foreign_key "notification_silence_component_id_fkey" { + columns = [column.component_id] + ref_columns = [table.components.column.id] + on_update = NO_ACTION + on_delete = NO_ACTION + } + foreign_key "notification_silence_canary_id_fkey" { + columns = [column.canary_id] + ref_columns = [table.canaries.column.id] + on_update = NO_ACTION + on_delete = NO_ACTION + } } \ No newline at end of file diff --git a/views/021_notification.sql b/views/021_notification.sql index c34398fe..f651d2cd 100644 --- a/views/021_notification.sql +++ b/views/021_notification.sql @@ -67,4 +67,4 @@ BEGIN VALUES (p_notification_id, p_status, p_source_event, p_resource_id); END IF; END; -$$ LANGUAGE plpgsql; \ No newline at end of file +$$ LANGUAGE plpgsql;