aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--schema/20181116.sql11
1 files changed, 9 insertions, 2 deletions
diff --git a/schema/20181116.sql b/schema/20181116.sql
index fcf14b8..ed347a5 100644
--- a/schema/20181116.sql
+++ b/schema/20181116.sql
@@ -53,7 +53,8 @@ CREATE TABLE notifications (
states integer[] not null,
output text,
inserted timestamp with time zone DEFAULT now() NOT NULL,
- sent timestamp with time zone
+ sent timestamp with time zone,
+ check_host text not null
);
CREATE TABLE active_checks (
@@ -63,10 +64,16 @@ CREATE TABLE active_checks (
states integer[] DEFAULT ARRAY[0] NOT NULL,
intval interval NOT NULL,
enabled boolean NOT NULL,
- notify boolean NOT NULL,
notice text
);
+create table checks_notify(
+ check_id bigint not null references checks(id) on delete cascade,
+ notifier_id int not null references notifier(id) on delete cascade,
+ enabled bool not null default true,
+ unique(check_id, notifier_id)
+);
+
CREATE INDEX ON active_checks(next_time) WHERE enabled;
CREATE INDEX ON checks(updated, last_refresh nulls first);
CREATE INDEX ON checks(node_id);