CREATE TABLE LOG_ENTRYS
(
 TIME         DATETIME      NOT NULL,
 PRIORITY     VARCHAR(10)   NOT NULL,
 CATEGORY     VARCHAR(64)   NOT NULL,
 MESSAGE      VARCHAR(255)  NOT NULL,
 THROWABLE    VARCHAR(255),
 HOSTNAME     VARCHAR(255)
);

DROP TABLE LOG_ENTRYS2;
DROP TABLE LOG_ENTRYS2_PRIORITY_SET;
DROP TABLE LOG_ENTRYS2_CATEGORY_SET;

CREATE TABLE LOG_ENTRYS2_PRIORITY_SET
(
 ID           INT           PRIMARY KEY,
 NAME         VARCHAR(255)  NOT NULL
);

CREATE TABLE LOG_ENTRYS2_CATEGORY_SET
(
 ID           INT           PRIMARY KEY,
 NAME         VARCHAR(255)  NOT NULL
);

CREATE TABLE LOG_ENTRYS2
(
 TIME         DATETIME      NOT NULL,
 PRIORITY     INT           NOT NULL REFERENCES LOG_ENTRYS2_PRIORITY_SET(ID),
 CATEGORY     INT           NOT NULL REFERENCES LOG_ENTRYS2_CATEGORY_SET(ID),
 MESSAGE      VARCHAR(255)  NOT NULL,
 THROWABLE    VARCHAR(255),
 HOSTNAME     VARCHAR(255)
);

