diff options
author | Gibheer <gibheer+git@zero-knowledge.org> | 2019-01-11 13:04:35 +0100 |
---|---|---|
committer | Gibheer <gibheer+git@zero-knowledge.org> | 2019-01-11 13:04:35 +0100 |
commit | 168c425fb6954646c8a859296f7c85173e539c92 (patch) | |
tree | b353afdf9311ef2ea74ba74bf0005e996e3bde86 /schema | |
parent | 203ca756e14853d42663a334fb8bfd9f9aba2999 (diff) |
add missing table to database schema
The checks_notify table was missing and needs to be added. As this is
still alpha software, there is no need for a migration step yet.
Diffstat (limited to 'schema')
-rw-r--r-- | schema/20181116.sql | 11 |
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); |