CREATE TABLE servers ( hostname text NOT NULL, port integer NOT NULL, nickname text NOT NULL, "password" text, realnick text, lag integer, maxlag integer ); CREATE TABLE modules ( name text NOT NULL, ready boolean NOT NULL, "read" boolean NOT NULL, "write" boolean NOT NULL, autocommit boolean NOT NULL ); CREATE TABLE channels ( channel text NOT NULL, server text NOT NULL, joined boolean NOT NULL ); CREATE TABLE channel_users ( server text NOT NULL, channel text NOT NULL, nick text NOT NULL ); CREATE TABLE quotes ( server text NOT NULL, id integer NOT NULL, quote text, channel text NOT NULL ); ALTER TABLE ONLY servers ADD CONSTRAINT server_pkey PRIMARY KEY (hostname); ALTER TABLE ONLY modules ADD CONSTRAINT modules_pkey PRIMARY KEY (name); ALTER TABLE ONLY channels ADD CONSTRAINT channels_pkey PRIMARY KEY (channel, server); ALTER TABLE ONLY channel_users ADD CONSTRAINT channel_users_pkey PRIMARY KEY (server, channel, nick);