## This is a schema for MySQL for the calendar objects in Jetspeed
##
## This schema creates the tables needed for the calendar objects and
## initializes them.
##
## This schema is imported into MySQL with the folowing command
## mysql Turbine < MySQL_calendar_v1.0.sql

drop table if exists JETSPEED_VEVENT_OBJECTS;

create table JETSPEED_VEVENT_OBJECTS (
       VEVENT_ID integer AUTO_INCREMENT PRIMARY KEY,
       OWNER integer,
       READ_PERMISSION integer,
       WRITE_PERMISSION integer,
       CLASSIFICATION varchar(15),
       DATE_CREATED datetime,
       DESCRIPTION text,
       DTSTART_DATE_TIME datetime,
       DTSTART_DATE date,
       GEO_LATITUDE float,
       GEO_LONGITUDE float,
       LAST_MODIFIED datetime,
       LOCATION text,
       ORGANIZER varchar(80),
       PRIORITY integer,
       DTSTAMP datetime,
       SEQUENCE integer,
       STATUS varchar(15),
       SUMMARY varchar(80),
       TRANSPARENCY varchar(14),
       UNIQUE_ID varchar(100),
       URL varchar(80),
       RECUR_ID_DT datetime,
       RECUR_ID_D date,
       DTEND_DT datetime,
       DTEND_D date,
       DURATION integer,
       DESC_ALT_REP varchar(80),
       DESC_LANG varchar(10),
       LOCATION_ALT_REP varchar(80),
       LOCATION_LANG varchar(10),
       DTSTART_TZID varchar(80),
       ORGANIZER_NAME varchar(80),
       ORGANIZER_DIR varchar(80),
       ORGANIZER_SENTBY varchar(80),
       ORGANIZER_LANG varchar(10),
       SUMMARY_ALT_REP varchar(80),
       SUMMARY_LANG varchar(10),
       RECUR_ID_TZID varchar(80),
       RECUR_ID_RANGE varchar(16),
       DTEND_TZID varchar(80));
       
drop table if exists JETSPEED_VTODO_OBJECTS;

create table JETSPEED_VTODO_OBJECTS (
       VEVENT_ID integer AUTO_INCREMENT PRIMARY KEY,
       OWNER integer,
       READ_PERMISSION integer,
       WRITE_PERMISSION integer,
       CLASSIFICATION varchar(15),
       DATE_CREATED datetime,
       DESCRIPTION text,
       DTSTART_DATE_TIME datetime,
       DTSTART_DATE date,
       GEO_LATITUDE float,
       GEO_LONGITUDE float,
       LAST_MODIFIED datetime,
       LOCATION text,
       ORGANIZER varchar(80),
       PRIORITY integer,
       DTSTAMP datetime,
       SEQUENCE integer,
       STATUS varchar(15),
       SUMMARY varchar(80),
       UNIQUE_ID varchar(100),
       URL varchar(80),
       RECUR_ID_DT datetime,
       RECUR_ID_D date,
       DUE_DATE_TIME datetime,
       DUE_DATE date,
       DURATION integer,
       DESC_ALT_REP varchar(80),
       DESC_LANG varchar(10),
       LOCATION_ALT_REP varchar(80),
       LOCATION_LANG varchar(10),
       DTSTART_TZID varchar(80),
       ORGANIZER_NAME varchar(80),
       ORGANIZER_DIR varchar(80),
       ORGANIZER_SENTBY varchar(80),
       ORGANIZER_LANG varchar(10),
       SUMMARY_ALT_REP varchar(80),
       SUMMARY_LANG varchar(10),
       RECUR_ID_TZID varchar(80),
       RECUR_ID_RANGE varchar(16),
       DUE_TZID varchar(80),
       PERCENT integer,
       DATE_COMPLETED datetime
       );
       
