<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table MBBan (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	banId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	banUserId LONG,
	lastPublishDate DATE null,
	primary key (banId, ctCollectionId)
);

create table MBCategory (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	categoryId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	parentCategoryId LONG,
	name VARCHAR(255) null,
	description STRING null,
	displayStyle VARCHAR(75) null,
	friendlyURL VARCHAR(255) null,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (categoryId, ctCollectionId)
);

create table MBDiscussion (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	discussionId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	classNameId LONG,
	classPK LONG,
	threadId LONG,
	lastPublishDate DATE null,
	primary key (discussionId, ctCollectionId)
);

create table MBMailingList (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	mailingListId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	categoryId LONG,
	emailAddress VARCHAR(254) null,
	inProtocol VARCHAR(75) null,
	inServerName VARCHAR(75) null,
	inServerPort INTEGER,
	inUseSSL BOOLEAN,
	inUserName VARCHAR(75) null,
	inPassword VARCHAR(75) null,
	inReadInterval INTEGER,
	outEmailAddress VARCHAR(254) null,
	outCustom BOOLEAN,
	outServerName VARCHAR(75) null,
	outServerPort INTEGER,
	outUseSSL BOOLEAN,
	outUserName VARCHAR(75) null,
	outPassword VARCHAR(75) null,
	allowAnonymous BOOLEAN,
	active_ BOOLEAN,
	primary key (mailingListId, ctCollectionId)
);

create table MBMessage (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	messageId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	classNameId LONG,
	classPK LONG,
	categoryId LONG,
	threadId LONG,
	rootMessageId LONG,
	parentMessageId LONG,
	treePath STRING null,
	subject VARCHAR(255) null,
	urlSubject VARCHAR(255) null,
	body TEXT null,
	format VARCHAR(75) null,
	anonymous BOOLEAN,
	priority DOUBLE,
	allowPingbacks BOOLEAN,
	answer BOOLEAN,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (messageId, ctCollectionId)
);

create table MBSuspiciousActivity (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	suspiciousActivityId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	messageId LONG,
	threadId LONG,
	reason VARCHAR(255) null,
	validated BOOLEAN,
	primary key (suspiciousActivityId, ctCollectionId)
);

create table MBThread (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	threadId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	categoryId LONG,
	rootMessageId LONG,
	rootMessageUserId LONG,
	title VARCHAR(255) null,
	lastPostByUserId LONG,
	lastPostDate DATE null,
	priority DOUBLE,
	question BOOLEAN,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (threadId, ctCollectionId)
);

create table MBThreadFlag (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	threadFlagId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	threadId LONG,
	lastPublishDate DATE null,
	primary key (threadFlagId, ctCollectionId)
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create index IX_69951A25 on MBBan (banUserId);
create unique index IX_80F14E99 on MBBan (groupId, banUserId, ctCollectionId);
create index IX_48814BBA on MBBan (userId);
create unique index IX_6F119354 on MBBan (uuid_[$COLUMN_LENGTH:75$], groupId, ctCollectionId);

create index IX_BC735DCF on MBCategory (companyId);
create unique index IX_B73EC7E5 on MBCategory (groupId, ctCollectionId, friendlyURL[$COLUMN_LENGTH:255$]);
create index IX_72DC3FF5 on MBCategory (groupId, parentCategoryId, categoryId);
create index IX_F69FCDDB on MBCategory (groupId, parentCategoryId, status, categoryId);
create index IX_DA84A9F7 on MBCategory (groupId, status);
create unique index IX_7B308E1 on MBCategory (groupId, uuid_[$COLUMN_LENGTH:75$], ctCollectionId);
create index IX_AB585C29 on MBCategory (status, companyId);
create index IX_C2626EDB on MBCategory (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_4B5416 on MBDiscussion (ctCollectionId, classNameId, classPK);
create unique index IX_C88E75BA on MBDiscussion (ctCollectionId, threadId);
create unique index IX_BEBA7CFB on MBDiscussion (uuid_[$COLUMN_LENGTH:75$], ctCollectionId, groupId);

create index IX_BFEB984F on MBMailingList (active_);
create unique index IX_5AFAF63B on MBMailingList (groupId, ctCollectionId, categoryId);
create unique index IX_212E7CE on MBMailingList (uuid_[$COLUMN_LENGTH:75$], groupId, ctCollectionId);

create index IX_51A8D44D on MBMessage (classNameId, classPK);
create index IX_B1432D30 on MBMessage (companyId);
create index IX_1073AB9F on MBMessage (groupId, categoryId);
create unique index IX_CAD6292D on MBMessage (groupId, ctCollectionId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create unique index IX_C3FB4E01 on MBMessage (groupId, ctCollectionId, urlSubject[$COLUMN_LENGTH:255$]);
create index IX_1D0DEF85 on MBMessage (groupId, status, categoryId);
create index IX_5084DE7E on MBMessage (groupId, status, threadId, categoryId);
create index IX_D12CECD2 on MBMessage (groupId, status, userId);
create index IX_C19015CA on MBMessage (groupId, threadId, categoryId, answer);
create index IX_8EB8C5EC on MBMessage (groupId, userId);
create unique index IX_94D65020 on MBMessage (groupId, uuid_[$COLUMN_LENGTH:75$], ctCollectionId);
create index IX_58465030 on MBMessage (parentMessageId);
create index IX_936ECAB3 on MBMessage (status, classNameId, classPK);
create index IX_E4D73A8A on MBMessage (status, companyId);
create index IX_D6CD720A on MBMessage (status, parentMessageId);
create index IX_6F212FD7 on MBMessage (status, threadId);
create index IX_2E9F9D6D on MBMessage (status, userId, classNameId, classPK);
create index IX_9D7C3B23 on MBMessage (threadId, answer);
create index IX_A7038CD7 on MBMessage (threadId, parentMessageId);
create index IX_ABEB6D07 on MBMessage (userId, classNameId, classPK);
create index IX_C57B16BC on MBMessage (uuid_[$COLUMN_LENGTH:75$]);

create index IX_977DB0CB on MBSuspiciousActivity (messageId);
create index IX_9EE25540 on MBSuspiciousActivity (threadId);
create index IX_39C9A751 on MBSuspiciousActivity (userId, messageId);
create index IX_939A75FA on MBSuspiciousActivity (userId, threadId);
create unique index IX_A3E15B5B on MBSuspiciousActivity (uuid_[$COLUMN_LENGTH:75$], groupId, ctCollectionId);

create index IX_41F6DC8A on MBThread (categoryId, priority);
create index IX_50F1904A on MBThread (groupId, categoryId, lastPostDate);
create index IX_485F7E98 on MBThread (groupId, categoryId, status);
create index IX_E1E7142B on MBThread (groupId, status);
create unique index IX_4790702D on MBThread (groupId, uuid_[$COLUMN_LENGTH:75$], ctCollectionId);
create index IX_15AE30B5 on MBThread (priority, lastPostDate);
create index IX_CC993ECB on MBThread (rootMessageId);
create index IX_7E264A0F on MBThread (uuid_[$COLUMN_LENGTH:75$]);

create index IX_8CB0A24A on MBThreadFlag (threadId);
create unique index IX_B2386762 on MBThreadFlag (userId, threadId, ctCollectionId);
create unique index IX_78C515E9 on MBThreadFlag (uuid_[$COLUMN_LENGTH:75$], ctCollectionId, groupId);]]></indexes-sql>
</data>