<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table DDLRecord (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	recordId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	versionUserId LONG,
	versionUserName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	DDMStorageId LONG,
	recordSetId LONG,
	recordSetVersion VARCHAR(75) null,
	className VARCHAR(300) null,
	classPK LONG,
	version VARCHAR(75) null,
	displayIndex INTEGER,
	lastPublishDate DATE null,
	primary key (recordId, ctCollectionId)
);

create table DDLRecordSet (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	recordSetId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	versionUserId LONG,
	versionUserName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	DDMStructureId LONG,
	recordSetKey VARCHAR(75) null,
	version VARCHAR(75) null,
	name STRING null,
	description STRING null,
	minDisplayRows INTEGER,
	scope INTEGER,
	settings_ TEXT null,
	lastPublishDate DATE null,
	primary key (recordSetId, ctCollectionId)
);

create table DDLRecordSetVersion (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	recordSetVersionId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	recordSetId LONG,
	DDMStructureVersionId LONG,
	name STRING null,
	description STRING null,
	settings_ TEXT null,
	version VARCHAR(75) null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (recordSetVersionId, ctCollectionId)
);

create table DDLRecordVersion (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	recordVersionId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	DDMStorageId LONG,
	recordSetId LONG,
	recordSetVersion VARCHAR(75) null,
	recordId LONG,
	version VARCHAR(75) null,
	displayIndex INTEGER,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (recordVersionId, ctCollectionId)
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create index IX_D443D273 on DDLRecord (className[$COLUMN_LENGTH:300$], classPK);
create index IX_6A6C1C85 on DDLRecord (companyId);
create index IX_F12C61D4 on DDLRecord (recordSetId, recordSetVersion[$COLUMN_LENGTH:75$]);
create index IX_AAC564D3 on DDLRecord (recordSetId, userId);
create unique index IX_7E71D397 on DDLRecord (uuid_[$COLUMN_LENGTH:75$], groupId, ctCollectionId);

create index IX_6705D180 on DDLRecordSet (DDMStructureId);
create unique index IX_2C896CFF on DDLRecordSet (groupId, ctCollectionId, recordSetKey[$COLUMN_LENGTH:75$]);
create unique index IX_A7D89A3F on DDLRecordSet (uuid_[$COLUMN_LENGTH:75$], groupId, ctCollectionId);

create index IX_1C4E1CC9 on DDLRecordSetVersion (recordSetId, status);
create unique index IX_577F80E3 on DDLRecordSetVersion (recordSetId, version[$COLUMN_LENGTH:75$], ctCollectionId);

create index IX_762ADC7 on DDLRecordVersion (recordId, status);
create unique index IX_8EDB4BA5 on DDLRecordVersion (recordId, version[$COLUMN_LENGTH:75$], ctCollectionId);
create index IX_A1B81B16 on DDLRecordVersion (recordSetId, recordSetVersion[$COLUMN_LENGTH:75$], status, userId);]]></indexes-sql>
</data>