CREATE TABLE annotation (
    id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
    name varchar(32),
    description varchar(255),
    client_id INTEGER,
    secure BOOLEAN,
    singleton BOOLEAN
) ENGINE=InnoDB;

CREATE TABLE content_anno (
    id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
    content_id INTEGER,
    annotation_id INTEGER,
    user_id INTEGER,
    strings_id INTEGER,
    INDEX (content_id),
    INDEX (annotation_id)
) ENGINE=InnoDB;

CREATE TABLE auth (
    id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
    viewUsers varchar(255),
    viewGroups varchar(255),
    editUsers varchar(255),
    editGroups varchar(255)
) ENGINE=InnoDB;

CREATE TABLE ca_x_auth (
    content_anno_id INTEGER,
    auth_id INTEGER,
    INDEX(content_anno_id)
) ENGINE=InnoDB;

CREATE TABLE strings (
    id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
    value TEXT
) ENGINE=InnoDB;

CREATE TABLE user (
    id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT,
    name varchar(255)
) ENGINE=InnoDB;
