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

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

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

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