diff --git a/schema.sql b/schema.sql index 9e58e397c0c6ea76c993fdc8c18ff23edf72681a..4b065425ef8b0e79d8bc4a482eff9755f76ed337 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