<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table AccountEntry (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	accountEntryId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	defaultBillingAddressId LONG,
	defaultCPaymentMethodKey VARCHAR(75) null,
	defaultShippingAddressId LONG,
	parentAccountEntryId LONG,
	description STRING null,
	domains STRING null,
	emailAddress VARCHAR(254) null,
	logoId LONG,
	name VARCHAR(250) null,
	restrictMembership BOOLEAN,
	taxExemptionCode VARCHAR(75) null,
	taxIdNumber VARCHAR(75) null,
	type_ VARCHAR(75) null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null
);

create table AccountEntryOrganizationRel (
	mvccVersion LONG default 0 not null,
	accountEntryOrganizationRelId LONG not null primary key,
	companyId LONG,
	accountEntryId LONG,
	organizationId LONG
);

create table AccountEntryUserRel (
	mvccVersion LONG default 0 not null,
	accountEntryUserRelId LONG not null primary key,
	companyId LONG,
	accountEntryId LONG,
	accountUserId LONG
);

create table AccountGroup (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	accountGroupId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	defaultAccountGroup BOOLEAN,
	description VARCHAR(75) null,
	name VARCHAR(75) null,
	type_ VARCHAR(75) null
);

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

create table AccountRole (
	mvccVersion LONG default 0 not null,
	accountRoleId LONG not null primary key,
	companyId LONG,
	accountEntryId LONG,
	roleId LONG
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create unique index IX_FBFAF640 on AccountEntry (companyId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_48CB043 on AccountEntry (companyId, status);
create index IX_908C3410 on AccountEntry (userId, type_[$COLUMN_LENGTH:75$]);
create index IX_6901A669 on AccountEntry (uuid_[$COLUMN_LENGTH:75$]);

create index IX_EC6CC41D on AccountEntryOrganizationRel (accountEntryId, organizationId);
create index IX_2FA4FA69 on AccountEntryOrganizationRel (organizationId);

create index IX_ED720A80 on AccountEntryUserRel (accountEntryId, accountUserId);
create index IX_4EA60AB4 on AccountEntryUserRel (accountUserId);

create index IX_38BDB33 on AccountGroup (companyId, defaultAccountGroup);
create unique index IX_F7BFA1CD on AccountGroup (companyId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_8EE6A92F on AccountGroup (companyId, name[$COLUMN_LENGTH:75$]);
create index IX_B4733E65 on AccountGroup (companyId, type_[$COLUMN_LENGTH:75$]);
create index IX_E86A36FC on AccountGroup (uuid_[$COLUMN_LENGTH:75$]);

create index IX_448835E3 on AccountGroupRel (accountGroupId, classNameId, classPK);
create index IX_E31F0762 on AccountGroupRel (classNameId, classPK);

create index IX_3A47CDD on AccountRole (accountEntryId);
create index IX_6BCBD313 on AccountRole (companyId, accountEntryId);
create index IX_714A358E on AccountRole (roleId);]]></indexes-sql>
</data>