create table Calendar (
	uuid_ varchar(75),
	calendarId bigint not null primary key,
	groupId bigint,
	companyId bigint,
	userId bigint,
	userName varchar(75),
	createDate timestamp,
	modifiedDate timestamp,
	resourceBlockId bigint,
	calendarResourceId bigint,
	name varchar(4000),
	description varchar(4000),
	timeZoneId varchar(75),
	color integer,
	defaultCalendar smallint,
	enableComments smallint,
	enableRatings smallint
);

create table CalendarBooking (
	uuid_ varchar(75),
	calendarBookingId bigint not null primary key,
	groupId bigint,
	companyId bigint,
	userId bigint,
	userName varchar(75),
	createDate timestamp,
	modifiedDate timestamp,
	resourceBlockId bigint,
	calendarId bigint,
	calendarResourceId bigint,
	parentCalendarBookingId bigint,
	vEventUid varchar(255),
	title varchar(4000),
	description clob,
	location varchar(4000),
	startTime bigint,
	endTime bigint,
	allDay smallint,
	recurrence varchar(4000),
	firstReminder bigint,
	firstReminderType varchar(75),
	secondReminder bigint,
	secondReminderType varchar(75),
	status integer,
	statusByUserId bigint,
	statusByUserName varchar(75),
	statusDate timestamp
);

create table CalendarNotificationTemplate (
	uuid_ varchar(75),
	calendarNotificationTemplateId bigint not null primary key,
	groupId bigint,
	companyId bigint,
	userId bigint,
	userName varchar(75),
	createDate timestamp,
	modifiedDate timestamp,
	calendarId bigint,
	notificationType varchar(75),
	notificationTypeSettings varchar(75),
	notificationTemplateType varchar(75),
	subject varchar(75),
	body clob
);

create table CalendarResource (
	uuid_ varchar(75),
	calendarResourceId bigint not null primary key,
	groupId bigint,
	companyId bigint,
	userId bigint,
	userName varchar(75),
	createDate timestamp,
	modifiedDate timestamp,
	resourceBlockId bigint,
	classNameId bigint,
	classPK bigint,
	classUuid varchar(75),
	code_ varchar(75),
	name varchar(4000),
	description varchar(4000),
	active_ smallint
);
