<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table CPLCommerceGroupAccountRel (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	CPLCommerceAccountGroupRelId LONG not null,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commercePriceListId LONG,
	commerceAccountGroupId LONG,
	order_ INTEGER,
	lastPublishDate DATE null,
	primary key (CPLCommerceAccountGroupRelId, ctCollectionId)
);

create table CommercePriceEntry (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commercePriceEntryId LONG not null,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commercePriceListId LONG,
	CPInstanceUuid VARCHAR(75) null,
	CProductId LONG,
	bulkPricing BOOLEAN,
	discountDiscovery BOOLEAN,
	discountLevel1 BIGDECIMAL null,
	discountLevel2 BIGDECIMAL null,
	discountLevel3 BIGDECIMAL null,
	discountLevel4 BIGDECIMAL null,
	displayDate DATE null,
	expirationDate DATE null,
	hasTierPrice BOOLEAN,
	price BIGDECIMAL null,
	priceOnApplication BOOLEAN,
	promoPrice BIGDECIMAL null,
	quantity BIGDECIMAL null,
	unitOfMeasureKey VARCHAR(75) null,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (commercePriceEntryId, ctCollectionId)
);

create table CommercePriceList (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commercePriceListId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceCurrencyId LONG,
	parentCommercePriceListId LONG,
	catalogBasePriceList BOOLEAN,
	netPrice BOOLEAN,
	type_ VARCHAR(75) null,
	name VARCHAR(75) null,
	priority DOUBLE,
	displayDate DATE null,
	expirationDate DATE null,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (commercePriceListId, ctCollectionId)
);

create table CommercePriceListAccountRel (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	commercePriceListAccountRelId LONG not null,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceAccountId LONG,
	commercePriceListId LONG,
	order_ INTEGER,
	lastPublishDate DATE null,
	primary key (commercePriceListAccountRelId, ctCollectionId)
);

create table CommercePriceListChannelRel (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	CommercePriceListChannelRelId LONG not null,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceChannelId LONG,
	commercePriceListId LONG,
	order_ INTEGER,
	lastPublishDate DATE null,
	primary key (CommercePriceListChannelRelId, ctCollectionId)
);

create table CommercePriceListDiscountRel (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	commercePriceListDiscountRelId LONG not null,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceDiscountId LONG,
	commercePriceListId LONG,
	order_ INTEGER,
	lastPublishDate DATE null,
	primary key (commercePriceListDiscountRelId, ctCollectionId)
);

create table CommercePriceListOrderTypeRel (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	CPriceListOrderTypeRelId LONG not null,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commercePriceListId LONG,
	commerceOrderTypeId LONG,
	priority INTEGER,
	lastPublishDate DATE null,
	primary key (CPriceListOrderTypeRelId, ctCollectionId)
);

create table CommerceTierPriceEntry (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commerceTierPriceEntryId LONG not null,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commercePriceEntryId LONG,
	price BIGDECIMAL null,
	promoPrice BIGDECIMAL null,
	discountDiscovery BOOLEAN,
	discountLevel1 BIGDECIMAL null,
	discountLevel2 BIGDECIMAL null,
	discountLevel3 BIGDECIMAL null,
	discountLevel4 BIGDECIMAL null,
	minQuantity BIGDECIMAL null,
	displayDate DATE null,
	expirationDate DATE null,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (commerceTierPriceEntryId, ctCollectionId)
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create unique index IX_8EF03EDA on CPLCommerceGroupAccountRel (commercePriceListId, commerceAccountGroupId, ctCollectionId);
create index IX_29EF081D on CPLCommerceGroupAccountRel (uuid_[$COLUMN_LENGTH:75$]);

create index IX_20ED9B62 on CommercePriceEntry (CPInstanceUuid[$COLUMN_LENGTH:75$], commercePriceListId, status);
create index IX_CCBB916A on CommercePriceEntry (CPInstanceUuid[$COLUMN_LENGTH:75$], quantity, unitOfMeasureKey[$COLUMN_LENGTH:75$]);
create index IX_CA7A2D0D on CommercePriceEntry (commercePriceListId);
create unique index IX_95608EBD on CommercePriceEntry (companyId, externalReferenceCode[$COLUMN_LENGTH:75$], ctCollectionId);
create index IX_B9AEC410 on CommercePriceEntry (status, displayDate);
create index IX_255AF6E1 on CommercePriceEntry (status, expirationDate);
create index IX_C15BC5AA on CommercePriceEntry (uuid_[$COLUMN_LENGTH:75$]);

create index IX_473B4D8D on CommercePriceList (commerceCurrencyId);
create unique index IX_A0692909 on CommercePriceList (companyId, ctCollectionId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_3AE5B429 on CommercePriceList (groupId, catalogBasePriceList);
create index IX_3BE0F85F on CommercePriceList (groupId, companyId, status, type_[$COLUMN_LENGTH:75$]);
create index IX_31F12A8E on CommercePriceList (groupId, type_[$COLUMN_LENGTH:75$], catalogBasePriceList);
create unique index IX_22D6C1BA on CommercePriceList (groupId, uuid_[$COLUMN_LENGTH:75$], ctCollectionId);
create index IX_863045BB on CommercePriceList (parentCommercePriceListId);
create index IX_72305848 on CommercePriceList (status, displayDate);
create index IX_1B0C9BE2 on CommercePriceList (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_5FBCA042 on CommercePriceListAccountRel (commercePriceListId, commerceAccountId, ctCollectionId);
create index IX_919FF916 on CommercePriceListAccountRel (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_6B436902 on CommercePriceListChannelRel (commercePriceListId, commerceChannelId, ctCollectionId);
create index IX_A7045AEC on CommercePriceListChannelRel (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_7D707AEE on CommercePriceListDiscountRel (commercePriceListId, commerceDiscountId, ctCollectionId);
create index IX_4F76A982 on CommercePriceListDiscountRel (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_4EA60BE2 on CommercePriceListOrderTypeRel (commercePriceListId, commerceOrderTypeId, ctCollectionId);
create index IX_C6ECAD11 on CommercePriceListOrderTypeRel (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_4072830C on CommerceTierPriceEntry (commercePriceEntryId, minQuantity, ctCollectionId);
create index IX_89DE1E88 on CommerceTierPriceEntry (commercePriceEntryId, status, minQuantity);
create unique index IX_4B03AB43 on CommerceTierPriceEntry (companyId, ctCollectionId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_CB288BCE on CommerceTierPriceEntry (status, displayDate);
create index IX_D00E2E63 on CommerceTierPriceEntry (status, expirationDate);
create index IX_71F6D1E8 on CommerceTierPriceEntry (uuid_[$COLUMN_LENGTH:75$]);]]></indexes-sql>
</data>