CREATE TABLE identity (
       identityid serial PRIMARY KEY,
       userid integer NOT NULL REFERENCES quasseluser (userid) ON DELETE CASCADE,
       identityname varchar(64) NOT NULL,
       realname varchar(128) NOT NULL,
       awaynick varchar(64),
       awaynickenabled boolean NOT NULL DEFAULT FALSE,
       awayreason varchar(256),
       awayreasonenabled boolean NOT NULL DEFAULT FALSE,
       autoawayenabled boolean NOT NULL DEFAULT FALSE,
       autoawaytime integer NOT NULL,
       autoawayreason varchar(256),
       autoawayreasonenabled boolean NOT NULL DEFAULT FALSE,
       detachawayenabled boolean NOT NULL DEFAULT FALSE,
       detachawayreason varchar(256),
       detachawayreasonenabled boolean NOT NULL DEFAULT FALSE,
       ident varchar(64),
       kickreason varchar(256),
       partreason varchar(256),
       quitreason varchar(256),
       sslcert bytea,
       sslkey bytea,
       UNIQUE (userid, identityname)
)
