<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table NQueueEntryAttachment (
	mvccVersion LONG default 0 not null,
	NQueueEntryAttachmentId LONG not null primary key,
	companyId LONG,
	fileEntryId LONG,
	notificationQueueEntryId LONG
);

create table NTemplateAttachment (
	mvccVersion LONG default 0 not null,
	NTemplateAttachmentId LONG not null primary key,
	companyId LONG,
	notificationTemplateId LONG,
	objectFieldId LONG
);

create table NotificationQueueEntry (
	mvccVersion LONG default 0 not null,
	notificationQueueEntryId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	notificationTemplateId LONG,
	body TEXT null,
	classNameId LONG,
	classPK LONG,
	priority DOUBLE,
	sentDate DATE null,
	subject TEXT null,
	type_ VARCHAR(75) null,
	status INTEGER
);

create table NotificationRecipient (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	notificationRecipientId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	classNameId LONG,
	classPK LONG
);

create table NotificationRecipientSetting (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	notificationRecipientSettingId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	notificationRecipientId LONG,
	name VARCHAR(75) null,
	value STRING null
);

create table NotificationTemplate (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	notificationTemplateId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	objectDefinitionId LONG,
	body TEXT null,
	description VARCHAR(255) null,
	editorType VARCHAR(75) null,
	name STRING null,
	recipientType VARCHAR(75) null,
	subject STRING null,
	system_ BOOLEAN,
	type_ VARCHAR(255) null
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create index IX_42E60133 on NQueueEntryAttachment (notificationQueueEntryId);

create unique index IX_8F1205E1 on NTemplateAttachment (notificationTemplateId, objectFieldId);

create index IX_83DBCE06 on NotificationQueueEntry (notificationTemplateId);
create index IX_3B9F9C6C on NotificationQueueEntry (sentDate);
create index IX_74855369 on NotificationQueueEntry (type_[$COLUMN_LENGTH:75$], status);

create index IX_470340CF on NotificationRecipient (classPK);
create index IX_2ADCE1A0 on NotificationRecipient (uuid_[$COLUMN_LENGTH:75$]);

create index IX_B6D4DBB0 on NotificationRecipientSetting (notificationRecipientId, name[$COLUMN_LENGTH:75$]);
create index IX_5B9A04C on NotificationRecipientSetting (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_66991536 on NotificationTemplate (externalReferenceCode[$COLUMN_LENGTH:75$], companyId);
create index IX_7256D229 on NotificationTemplate (uuid_[$COLUMN_LENGTH:75$]);]]></indexes-sql>
</data>