From 0436c1fddb590c0c7d0e06973a75eae92063618c Mon Sep 17 00:00:00 2001 From: Janne Koschinski <janne@kuschku.de> Date: Fri, 25 May 2018 00:20:28 +0200 Subject: [PATCH] Update schema --- schema.sql | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/schema.sql b/schema.sql index 9e58e39..4b06542 100644 --- a/schema.sql +++ b/schema.sql @@ -44,4 +44,14 @@ create table "references" ( time timestamp, source text, target text -); \ No newline at end of file +); + +CREATE TABLE public.groups ( + channel int NOT NULL, + nick text NOT NULL, + "group" text NOT NULL, + CONSTRAINT groups_channel_nick_pk PRIMARY KEY (channel, nick), + CONSTRAINT groups_channels_id_fk FOREIGN KEY (channel) REFERENCES channels (id) ON DELETE CASCADE ON UPDATE CASCADE +); +CREATE INDEX groups_channel_nick_index + ON public.groups (channel, nick); \ No newline at end of file -- GitLab