CREATE SEQUENCE authtokens_id_seq;
CREATE TABLE AuthTokens (
    id                integer                  DEFAULT nextval('authtokens_id_seq'),
    Owner             integer         NOT NULL DEFAULT 0,
    Token             varchar(256)    NULL,
    Description       varchar(255)    NOT NULL DEFAULT '',
    LastUsed          timestamp                DEFAULT NULL,
    Creator           integer         NOT NULL DEFAULT 0,
    Created           timestamp                DEFAULT NULL,
    LastUpdatedBy     integer         NOT NULL DEFAULT 0,
    LastUpdated       timestamp                DEFAULT NULL,
    PRIMARY KEY (id)
);

CREATE INDEX AuthTokensOwner ON AuthTokens (Owner);
