aboutsummaryrefslogtreecommitdiff
path: root/schema/20181116.sql
diff options
context:
space:
mode:
authorGibheer <gibheer+git@zero-knowledge.org>2022-11-22 21:23:26 +0100
committerGibheer <gibheer+git@zero-knowledge.org>2022-11-22 21:23:26 +0100
commitd00e3f4a410ef27d2aa9c8eee08ec9146a4b2fa7 (patch)
tree32a7fd03885457816bbad51c507143f71a3fade6 /schema/20181116.sql
parentfe6bd04947e26a962fab3cf7a354abd44333bda6 (diff)
remove old schema file
This file is incompatible with all the following schema files. Therefore remove it and make the installation a bit smoother.
Diffstat (limited to 'schema/20181116.sql')
-rw-r--r--schema/20181116.sql85
1 files changed, 0 insertions, 85 deletions
diff --git a/schema/20181116.sql b/schema/20181116.sql
deleted file mode 100644
index ed347a5..0000000
--- a/schema/20181116.sql
+++ /dev/null
@@ -1,85 +0,0 @@
-BEGIN;
-CREATE TABLE notifier (
- id serial NOT NULL primary key,
- name text NOT NULL
-);
-
-CREATE TABLE groups (
- id serial NOT NULL primary key,
- name text NOT NULL
-);
-
-CREATE TABLE nodes (
- id bigserial NOT NULL primary key,
- name text NOT NULL,
- updated timestamp with time zone DEFAULT now() NOT NULL,
- created timestamp with time zone DEFAULT now() NOT NULL,
- message text NOT NULL
-);
-
-CREATE TABLE nodes_groups (
- node_id bigint not null references nodes(id) on delete cascade,
- group_id int not null references groups(id) on delete cascade,
- unique(node_id, group_id)
-);
-
-CREATE TABLE commands (
- id serial NOT NULL primary key,
- name text NOT NULL,
- command text NOT NULL,
- updated timestamp with time zone DEFAULT now() NOT NULL,
- created timestamp with time zone DEFAULT now() NOT NULL,
- message text NOT NULL
-);
-
-CREATE TABLE checks (
- id bigserial NOT NULL primary key,
- node_id integer references nodes(id) on delete cascade,
- command_id integer references commands(id) on delete cascade,
- intval interval DEFAULT '00:05:00'::interval NOT NULL,
- options jsonb DEFAULT '{}'::jsonb NOT NULL,
- updated timestamp with time zone DEFAULT now() NOT NULL,
- last_refresh timestamp with time zone,
- enabled boolean not null DEFAULT true,
- notifier_id integer NOT NULL,
- notify boolean DEFAULT true NOT NULL,
- message text NOT NULL,
- unique(node_id, command_id)
-);
-
-CREATE TABLE notifications (
- id bigserial NOT NULL primary key,
- check_id bigint not null references checks(id) on delete cascade,
- states integer[] not null,
- output text,
- inserted timestamp with time zone DEFAULT now() NOT NULL,
- sent timestamp with time zone,
- check_host text not null
-);
-
-CREATE TABLE active_checks (
- check_id bigint NOT NULL unique references checks(id) on delete cascade,
- cmdline text[] NOT NULL,
- next_time timestamp with time zone DEFAULT now() NOT NULL,
- states integer[] DEFAULT ARRAY[0] NOT NULL,
- intval interval NOT NULL,
- enabled 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);
-CREATE INDEX ON checks(command_id);
-CREATE INDEX ON notifications(inserted) WHERE sent is null;
-CREATE INDEX ON notifications (check_id, inserted desc);
-CREATE INDEX ON commands(updated);
-CREATE INDEX ON nodes(updated);
-COMMIT;