<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table WikiNode (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	nodeId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	name VARCHAR(75) null,
	description STRING null,
	lastPostDate DATE null,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (nodeId, ctCollectionId)
);

create table WikiPage (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	pageId LONG not null,
	resourcePrimKey LONG,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	externalReferenceCode VARCHAR(75) null,
	nodeId LONG,
	title VARCHAR(255) null,
	version DOUBLE,
	minorEdit BOOLEAN,
	content TEXT null,
	summary STRING null,
	format VARCHAR(75) null,
	head BOOLEAN,
	parentTitle VARCHAR(255) null,
	redirectTitle VARCHAR(255) null,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (pageId, ctCollectionId)
);

create table WikiPageResource (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	resourcePrimKey LONG not null,
	groupId LONG,
	companyId LONG,
	nodeId LONG,
	title VARCHAR(255) null,
	primary key (resourcePrimKey, ctCollectionId)
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create index IX_B54332D6 on WikiNode (companyId, status);
create unique index IX_4378AA6D on WikiNode (groupId, ctCollectionId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create unique index IX_2C8CCC8F on WikiNode (groupId, ctCollectionId, name[$COLUMN_LENGTH:75$]);
create index IX_23325358 on WikiNode (groupId, status);
create unique index IX_73235160 on WikiNode (groupId, uuid_[$COLUMN_LENGTH:75$], ctCollectionId);
create index IX_6C112D7C on WikiNode (uuid_[$COLUMN_LENGTH:75$]);

create index IX_B65BBC83 on WikiPage (companyId);
create index IX_8DBCF518 on WikiPage (externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_A2001730 on WikiPage (format[$COLUMN_LENGTH:75$]);
create unique index IX_5769831 on WikiPage (groupId, ctCollectionId, uuid_[$COLUMN_LENGTH:75$]);
create unique index IX_B6761658 on WikiPage (groupId, ctCollectionId, version, externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_F8CFBCE8 on WikiPage (nodeId, head, groupId, title[$COLUMN_LENGTH:255$]);
create index IX_65E84AF4 on WikiPage (nodeId, head, parentTitle[$COLUMN_LENGTH:255$]);
create index IX_64CCB282 on WikiPage (nodeId, head, redirectTitle[$COLUMN_LENGTH:255$]);
create index IX_E30FDBD1 on WikiPage (nodeId, head, resourcePrimKey);
create index IX_FCA31EC4 on WikiPage (nodeId, head, status, groupId, parentTitle[$COLUMN_LENGTH:255$]);
create index IX_9DEB1BCE on WikiPage (nodeId, head, status, parentTitle[$COLUMN_LENGTH:255$]);
create index IX_A75EB4DC on WikiPage (nodeId, head, status, redirectTitle[$COLUMN_LENGTH:255$]);
create index IX_676415FE on WikiPage (nodeId, head, title[$COLUMN_LENGTH:255$]);
create index IX_46EEF3C8 on WikiPage (nodeId, parentTitle[$COLUMN_LENGTH:255$]);
create index IX_1ECC7656 on WikiPage (nodeId, redirectTitle[$COLUMN_LENGTH:255$]);
create unique index IX_D1FC265 on WikiPage (nodeId, resourcePrimKey, ctCollectionId, version);
create index IX_6F9E3908 on WikiPage (nodeId, status, groupId, userId);
create index IX_D1F6BA7F on WikiPage (nodeId, status, resourcePrimKey);
create index IX_4A2D62C on WikiPage (nodeId, status, title[$COLUMN_LENGTH:255$]);
create index IX_EF476996 on WikiPage (nodeId, status, userId);
create unique index IX_C6E9CBD8 on WikiPage (nodeId, title[$COLUMN_LENGTH:255$], ctCollectionId, version);
create index IX_85E7CC76 on WikiPage (resourcePrimKey);
create index IX_5D2E2B50 on WikiPage (status, resourcePrimKey);
create index IX_9C0E478F on WikiPage (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_DF42DE46 on WikiPageResource (ctCollectionId, nodeId, title[$COLUMN_LENGTH:255$]);
create unique index IX_B2B35D0B on WikiPageResource (uuid_[$COLUMN_LENGTH:75$], ctCollectionId, groupId);]]></indexes-sql>
</data>