<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table CNTemplateCAccountGroupRel (
	mvccVersion LONG default 0 not null,
	CNTemplateCAccountGroupRelId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceNotificationTemplateId LONG,
	commerceAccountGroupId LONG
);

create table CNotificationAttachment (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	CNotificationAttachmentId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	CNotificationQueueEntryId LONG,
	fileEntryId LONG,
	deleteOnSend BOOLEAN
);

create table CommerceNotificationQueueEntry (
	mvccVersion LONG default 0 not null,
	CNotificationQueueEntryId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	classNameId LONG,
	classPK LONG,
	commerceNotificationTemplateId LONG,
	from_ VARCHAR(75) null,
	fromName VARCHAR(75) null,
	to_ VARCHAR(75) null,
	toName VARCHAR(75) null,
	cc VARCHAR(255) null,
	bcc VARCHAR(255) null,
	subject VARCHAR(255) null,
	body TEXT null,
	priority DOUBLE,
	sent BOOLEAN,
	sentDate DATE null
);

create table CommerceNotificationTemplate (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	commerceNotificationTemplateId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	name VARCHAR(75) null,
	description STRING null,
	from_ TEXT null,
	fromName STRING null,
	to_ TEXT null,
	cc TEXT null,
	bcc TEXT null,
	type_ VARCHAR(75) null,
	enabled BOOLEAN,
	subject STRING null,
	body TEXT null
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create index IX_7951AAEB on CNTemplateCAccountGroupRel (commerceAccountGroupId);
create unique index IX_AFBF7DA on CNTemplateCAccountGroupRel (commerceNotificationTemplateId, commerceAccountGroupId);

create index IX_6E9D8183 on CNotificationAttachment (CNotificationQueueEntryId);
create unique index IX_339EA78D on CNotificationAttachment (uuid_[$COLUMN_LENGTH:75$], groupId);

create index IX_F9149FC on CommerceNotificationQueueEntry (commerceNotificationTemplateId);
create index IX_56F7649E on CommerceNotificationQueueEntry (groupId, sent, classNameId, classPK);
create index IX_BEFF6FD9 on CommerceNotificationQueueEntry (sent);
create index IX_80026CA7 on CommerceNotificationQueueEntry (sentDate);

create index IX_6D6C3008 on CommerceNotificationTemplate (groupId, enabled, type_[$COLUMN_LENGTH:75$]);
create unique index IX_56F147B0 on CommerceNotificationTemplate (groupId, uuid_[$COLUMN_LENGTH:75$]);
create index IX_753B890E on CommerceNotificationTemplate (uuid_[$COLUMN_LENGTH:75$]);]]></indexes-sql>
</data>