<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table Calendar (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	calendarId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	calendarResourceId LONG,
	name STRING null,
	description STRING null,
	timeZoneId VARCHAR(75) null,
	color INTEGER,
	defaultCalendar BOOLEAN,
	enableComments BOOLEAN,
	enableRatings BOOLEAN,
	lastPublishDate DATE null,
	primary key (calendarId, ctCollectionId)
);

create table CalendarBooking (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	calendarBookingId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	calendarId LONG,
	calendarResourceId LONG,
	parentCalendarBookingId LONG,
	recurringCalendarBookingId LONG,
	vEventUid VARCHAR(255) null,
	title STRING null,
	description TEXT null,
	location STRING null,
	startTime LONG,
	endTime LONG,
	allDay BOOLEAN,
	recurrence STRING null,
	firstReminder LONG,
	firstReminderType VARCHAR(75) null,
	secondReminder LONG,
	secondReminderType VARCHAR(75) null,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (calendarBookingId, ctCollectionId)
);

create table CalendarNotificationTemplate (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	calendarNotificationTemplateId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	calendarId LONG,
	notificationType VARCHAR(75) null,
	notificationTypeSettings VARCHAR(200) null,
	notificationTemplateType VARCHAR(75) null,
	subject VARCHAR(75) null,
	body TEXT null,
	lastPublishDate DATE null,
	primary key (calendarNotificationTemplateId, ctCollectionId)
);

create table CalendarResource (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	calendarResourceId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	classNameId LONG,
	classPK LONG,
	classUuid VARCHAR(75) null,
	code_ VARCHAR(75) null,
	name STRING null,
	description STRING null,
	active_ BOOLEAN,
	lastPublishDate DATE null,
	primary key (calendarResourceId, ctCollectionId)
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create index IX_97FC174E on Calendar (groupId, calendarResourceId, defaultCalendar);
create unique index IX_31D79378 on Calendar (uuid_[$COLUMN_LENGTH:75$], groupId, ctCollectionId);

create unique index IX_9090D8F0 on CalendarBooking (calendarId, ctCollectionId, vEventUid[$COLUMN_LENGTH:255$]);
create unique index IX_BD5AA0AC on CalendarBooking (calendarId, parentCalendarBookingId, ctCollectionId);
create index IX_470170B4 on CalendarBooking (calendarId, status);
create index IX_B198FFC on CalendarBooking (calendarResourceId);
create index IX_F7B8A941 on CalendarBooking (parentCalendarBookingId, status);
create index IX_14ADC52E on CalendarBooking (recurringCalendarBookingId);
create unique index IX_99E210F9 on CalendarBooking (uuid_[$COLUMN_LENGTH:75$], ctCollectionId, groupId);

create index IX_7727A482 on CalendarNotificationTemplate (calendarId, notificationType[$COLUMN_LENGTH:75$], notificationTemplateType[$COLUMN_LENGTH:75$]);
create unique index IX_10D0E1DD on CalendarNotificationTemplate (uuid_[$COLUMN_LENGTH:75$], groupId, ctCollectionId);

create index IX_74AD9DDD on CalendarResource (active_, code_[$COLUMN_LENGTH:75$], companyId);
create unique index IX_D8D5DB05 on CalendarResource (ctCollectionId, classNameId, classPK);
create index IX_40678371 on CalendarResource (groupId, active_);
create index IX_55C2F8AA on CalendarResource (groupId, code_[$COLUMN_LENGTH:75$]);
create unique index IX_FD05567A on CalendarResource (groupId, uuid_[$COLUMN_LENGTH:75$], ctCollectionId);
create index IX_150E2F22 on CalendarResource (uuid_[$COLUMN_LENGTH:75$]);]]></indexes-sql>
</data>