
-----------------------------------------------------------------------------
-- MEDIA_TYPE
-----------------------------------------------------------------------------

CREATE TABLE MEDIA_TYPE
(
    MEDIATYPE_ID NUMBER(10,0) NOT NULL,
    NAME VARCHAR2(80) NOT NULL,
    CHARACTER_SET VARCHAR2(40),
    TITLE VARCHAR2(80),
    DESCRIPTION VARCHAR2(2000)
);

ALTER TABLE MEDIA_TYPE
    ADD CONSTRAINT MEDIA_TYPE_PK
PRIMARY KEY (MEDIATYPE_ID);






-----------------------------------------------------------------------------
-- CLIENT
-----------------------------------------------------------------------------

CREATE TABLE CLIENT
(
    CLIENT_ID NUMBER(10,0) NOT NULL,
    EVAL_ORDER NUMBER(10,0) NOT NULL,
    NAME VARCHAR2(80) NOT NULL,
    USER_AGENT_PATTERN VARCHAR2(128),
    MANUFACTURER VARCHAR2(80),
    MODEL VARCHAR2(80),
    VERSION VARCHAR2(40),
    PREFERRED_MIMETYPE_ID NUMBER(10,0) NOT NULL
);

ALTER TABLE CLIENT
    ADD CONSTRAINT CLIENT_PK
PRIMARY KEY (CLIENT_ID);






-----------------------------------------------------------------------------
-- MIMETYPE
-----------------------------------------------------------------------------

CREATE TABLE MIMETYPE
(
    MIMETYPE_ID NUMBER(10,0) NOT NULL,
    NAME VARCHAR2(80) NOT NULL
);

ALTER TABLE MIMETYPE
    ADD CONSTRAINT MIMETYPE_PK
PRIMARY KEY (MIMETYPE_ID);






-----------------------------------------------------------------------------
-- CAPABILITY
-----------------------------------------------------------------------------

CREATE TABLE CAPABILITY
(
    CAPABILITY_ID NUMBER(10,0) NOT NULL,
    CAPABILITY VARCHAR2(80) NOT NULL
);

ALTER TABLE CAPABILITY
    ADD CONSTRAINT CAPABILITY_PK
PRIMARY KEY (CAPABILITY_ID);






-----------------------------------------------------------------------------
-- CLIENT_TO_CAPABILITY
-----------------------------------------------------------------------------

CREATE TABLE CLIENT_TO_CAPABILITY
(
    CLIENT_ID NUMBER(10,0) NOT NULL,
    CAPABILITY_ID NUMBER(10,0) NOT NULL
);







-----------------------------------------------------------------------------
-- CLIENT_TO_MIMETYPE
-----------------------------------------------------------------------------

CREATE TABLE CLIENT_TO_MIMETYPE
(
    CLIENT_ID NUMBER(10,0) NOT NULL,
    MIMETYPE_ID NUMBER(10,0) NOT NULL
);







-----------------------------------------------------------------------------
-- MEDIATYPE_TO_CAPABILITY
-----------------------------------------------------------------------------

CREATE TABLE MEDIATYPE_TO_CAPABILITY
(
    MEDIATYPE_ID NUMBER(10,0) NOT NULL,
    CAPABILITY_ID NUMBER(10,0) NOT NULL
);







-----------------------------------------------------------------------------
-- MEDIATYPE_TO_MIMETYPE
-----------------------------------------------------------------------------

CREATE TABLE MEDIATYPE_TO_MIMETYPE
(
    MEDIATYPE_ID NUMBER(10,0) NOT NULL,
    MIMETYPE_ID NUMBER(10,0) NOT NULL
);







-----------------------------------------------------------------------------
-- PORTLET_STATISTICS
-----------------------------------------------------------------------------

CREATE TABLE PORTLET_STATISTICS
(
    IPADDRESS VARCHAR2(80),
    USER_NAME VARCHAR2(80),
    TIME_STAMP TIMESTAMP,
    PAGE VARCHAR2(80),
    PORTLET VARCHAR2(255),
    STATUS NUMBER(10,0),
    ELAPSED_TIME NUMBER(20,0)
);







-----------------------------------------------------------------------------
-- PAGE_STATISTICS
-----------------------------------------------------------------------------

CREATE TABLE PAGE_STATISTICS
(
    IPADDRESS VARCHAR2(80),
    USER_NAME VARCHAR2(80),
    TIME_STAMP TIMESTAMP,
    PAGE VARCHAR2(80),
    STATUS NUMBER(10,0),
    ELAPSED_TIME NUMBER(20,0)
);







-----------------------------------------------------------------------------
-- USER_STATISTICS
-----------------------------------------------------------------------------

CREATE TABLE USER_STATISTICS
(
    IPADDRESS VARCHAR2(80),
    USER_NAME VARCHAR2(80),
    TIME_STAMP TIMESTAMP,
    STATUS NUMBER(10,0),
    ELAPSED_TIME NUMBER(20,0)
);







-----------------------------------------------------------------------------
-- ADMIN_ACTIVITY
-----------------------------------------------------------------------------

CREATE TABLE ADMIN_ACTIVITY
(
    ACTIVITY VARCHAR2(40),
    CATEGORY VARCHAR2(40),
    ADMIN VARCHAR2(80),
    USER_NAME VARCHAR2(80),
    TIME_STAMP TIMESTAMP,
    IPADDRESS VARCHAR2(80),
    ATTR_NAME VARCHAR2(40),
    ATTR_VALUE_BEFORE VARCHAR2(80),
    ATTR_VALUE_AFTER VARCHAR2(80),
    DESCRIPTION VARCHAR2(128)
);







-----------------------------------------------------------------------------
-- USER_ACTIVITY
-----------------------------------------------------------------------------

CREATE TABLE USER_ACTIVITY
(
    ACTIVITY VARCHAR2(40),
    CATEGORY VARCHAR2(40),
    USER_NAME VARCHAR2(80),
    TIME_STAMP TIMESTAMP,
    IPADDRESS VARCHAR2(80),
    ATTR_NAME VARCHAR2(40),
    ATTR_VALUE_BEFORE VARCHAR2(80),
    ATTR_VALUE_AFTER VARCHAR2(80),
    DESCRIPTION VARCHAR2(128)
);
































