﻿CREATE TABLE public.kicks
(
   id serial PRIMARY KEY, 
   channel character varying(64) NOT NULL, 
   channel_network character varying(40) NOT NULL, 
   "user" character varying(31) NOT NULL, 
   user_network character varying(40) NOT NULL, 
   given integer DEFAULT 0, 
   received integer DEFAULT 0,
   FOREIGN KEY (channel, channel_network) REFERENCES channels(name, network),
   FOREIGN KEY ("user", user_network) REFERENCES users(name, network),
   unique(channel, channel_network, "user", user_network)
);
ALTER TABLE public.kicks
  OWNER TO "pyRot";
