From 7e387d55b93a17edcc405a2fbd20c4fb7a1be843 Mon Sep 17 00:00:00 2001 From: Gibheer Date: Wed, 12 Dec 2018 13:33:30 +0100 Subject: add missing unique constraint There was a unique constraint missing on the active_checks table. --- schema/20181210.sql | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/schema/20181210.sql b/schema/20181210.sql index 9c24197..7d344b0 100644 --- a/schema/20181210.sql +++ b/schema/20181210.sql @@ -63,7 +63,7 @@ CREATE TABLE public.checks ( ); CREATE TABLE public.active_checks ( - check_id bigint NOT NULL references checks(id) on delete cascade, + check_id bigint NOT NULL unique references checks(id) on delete cascade, mapping_id int not null references mappings(id), cmdline text[] NOT NULL, next_time timestamp with time zone DEFAULT now() NOT NULL, @@ -94,8 +94,6 @@ CREATE TABLE public.notifications ( ); -CREATE INDEX ON public.active_checks USING btree (check_id); - CREATE INDEX ON public.active_checks USING btree (next_time) WHERE enabled; CREATE INDEX ON public.checks USING btree (command_id); -- cgit v1.2.3-70-g09d2