<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table CPricingClassCPDefinitionRel (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	CPricingClassCPDefinitionRelId LONG not null,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commercePricingClassId LONG,
	CPDefinitionId LONG,
	primary key (CPricingClassCPDefinitionRelId, ctCollectionId)
);

create table CommercePriceModifier (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commercePriceModifierId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commercePriceListId LONG,
	title VARCHAR(75) null,
	target VARCHAR(75) null,
	modifierAmount BIGDECIMAL null,
	modifierType VARCHAR(75) null,
	priority DOUBLE,
	active_ BOOLEAN,
	displayDate DATE null,
	expirationDate DATE null,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null,
	primary key (commercePriceModifierId, ctCollectionId)
);

create table CommercePriceModifierRel (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	commercePriceModifierRelId LONG not null,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commercePriceModifierId LONG,
	classNameId LONG,
	classPK LONG,
	primary key (commercePriceModifierRelId, ctCollectionId)
);

create table CommercePricingClass (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commercePricingClassId LONG not null,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	title STRING null,
	description STRING null,
	lastPublishDate DATE null,
	primary key (commercePricingClassId, ctCollectionId)
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create index IX_31653559 on CPricingClassCPDefinitionRel (CPDefinitionId);
create unique index IX_DA09B6F3 on CPricingClassCPDefinitionRel (commercePricingClassId, CPDefinitionId, ctCollectionId);

create index IX_176CA5EC on CommercePriceModifier (commercePriceListId);
create unique index IX_DB76B9C2 on CommercePriceModifier (companyId, ctCollectionId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_AEE7A167 on CommercePriceModifier (companyId, status, groupId);
create index IX_FCACD082 on CommercePriceModifier (companyId, target[$COLUMN_LENGTH:75$]);
create index IX_6A13CEF on CommercePriceModifier (status, displayDate);
create index IX_921ADDA2 on CommercePriceModifier (status, expirationDate);
create unique index IX_FAB45A5F on CommercePriceModifier (uuid_[$COLUMN_LENGTH:75$], groupId, ctCollectionId);

create index IX_391477EF on CommercePriceModifierRel (classNameId, classPK);
create unique index IX_510AD1A9 on CommercePriceModifierRel (commercePriceModifierId, classNameId, classPK, ctCollectionId);

create unique index IX_925EA26 on CommercePricingClass (companyId, externalReferenceCode[$COLUMN_LENGTH:75$], ctCollectionId);
create index IX_33040DE1 on CommercePricingClass (uuid_[$COLUMN_LENGTH:75$]);]]></indexes-sql>
</data>