<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table CPDAvailabilityEstimate (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	CPDAvailabilityEstimateId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceAvailabilityEstimateId LONG,
	CProductId LONG,
	lastPublishDate DATE null
);

create table CPDefinitionInventory (
	mvccVersion LONG default 0 not null,
	ctCollectionId LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	CPDefinitionInventoryId LONG not null,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	CPDefinitionId LONG,
	CPDefinitionInventoryEngine VARCHAR(75) null,
	lowStockActivity VARCHAR(75) null,
	displayAvailability BOOLEAN,
	displayStockQuantity BOOLEAN,
	minStockQuantity BIGDECIMAL null,
	backOrders BOOLEAN,
	minOrderQuantity BIGDECIMAL null,
	maxOrderQuantity BIGDECIMAL null,
	allowedOrderQuantities VARCHAR(75) null,
	multipleOrderQuantity BIGDECIMAL null,
	primary key (CPDefinitionInventoryId, ctCollectionId)
);

create table CSOptionAccountEntryRel (
	mvccVersion LONG default 0 not null,
	CSOptionAccountEntryRelId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	accountEntryId LONG,
	commerceChannelId LONG,
	commerceShippingMethodKey VARCHAR(75) null,
	commerceShippingOptionKey VARCHAR(75) null
);

create table CommerceAddressRestriction (
	mvccVersion LONG default 0 not null,
	commerceAddressRestrictionId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	classNameId LONG,
	classPK LONG,
	countryId LONG
);

create table CommerceAvailabilityEstimate (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	commerceAvailabilityEstimateId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	title STRING null,
	priority DOUBLE,
	lastPublishDate DATE null
);

create table CommerceOrder (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commerceOrderId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	billingAddressId LONG,
	commerceAccountId LONG,
	commerceCurrencyId LONG,
	commerceOrderTypeId LONG,
	commerceShippingMethodId LONG,
	deliveryCommerceTermEntryId LONG,
	paymentCommerceTermEntryId LONG,
	shippingAddressId LONG,
	advanceStatus VARCHAR(75) null,
	commercePaymentMethodKey VARCHAR(75) null,
	couponCode VARCHAR(75) null,
	deliveryCTermEntryDescription TEXT null,
	deliveryCommerceTermEntryName VARCHAR(75) null,
	lastPriceUpdateDate DATE null,
	manuallyAdjusted BOOLEAN,
	orderDate DATE null,
	orderStatus INTEGER,
	paymentCTermEntryDescription TEXT null,
	paymentCommerceTermEntryName VARCHAR(75) null,
	paymentStatus INTEGER,
	printedNote STRING null,
	purchaseOrderNumber VARCHAR(75) null,
	requestedDeliveryDate DATE null,
	shippable BOOLEAN,
	shippingAmount BIGDECIMAL null,
	shippingDiscountAmount BIGDECIMAL null,
	shippingDiscountPercentLevel1 BIGDECIMAL null,
	shippingDiscountPercentLevel2 BIGDECIMAL null,
	shippingDiscountPercentLevel3 BIGDECIMAL null,
	shippingDiscountPercentLevel4 BIGDECIMAL null,
	shippingDiscountPctLev1WithTax BIGDECIMAL null,
	shippingDiscountPctLev2WithTax BIGDECIMAL null,
	shippingDiscountPctLev3WithTax BIGDECIMAL null,
	shippingDiscountPctLev4WithTax BIGDECIMAL null,
	shippingDiscountWithTaxAmount BIGDECIMAL null,
	shippingOptionName VARCHAR(255) null,
	shippingWithTaxAmount BIGDECIMAL null,
	subtotal BIGDECIMAL null,
	subtotalDiscountAmount BIGDECIMAL null,
	subtotalDiscountPercentLevel1 BIGDECIMAL null,
	subtotalDiscountPercentLevel2 BIGDECIMAL null,
	subtotalDiscountPercentLevel3 BIGDECIMAL null,
	subtotalDiscountPercentLevel4 BIGDECIMAL null,
	subtotalDiscountPctLev1WithTax BIGDECIMAL null,
	subtotalDiscountPctLev2WithTax BIGDECIMAL null,
	subtotalDiscountPctLev3WithTax BIGDECIMAL null,
	subtotalDiscountPctLev4WithTax BIGDECIMAL null,
	subtotalDiscountWithTaxAmount BIGDECIMAL null,
	subtotalWithTaxAmount BIGDECIMAL null,
	taxAmount BIGDECIMAL null,
	total BIGDECIMAL null,
	totalDiscountAmount BIGDECIMAL null,
	totalDiscountPercentageLevel1 BIGDECIMAL null,
	totalDiscountPercentageLevel2 BIGDECIMAL null,
	totalDiscountPercentageLevel3 BIGDECIMAL null,
	totalDiscountPercentageLevel4 BIGDECIMAL null,
	totalDiscountPctLev1WithTax BIGDECIMAL null,
	totalDiscountPctLev2WithTax BIGDECIMAL null,
	totalDiscountPctLev3WithTax BIGDECIMAL null,
	totalDiscountPctLev4WithTax BIGDECIMAL null,
	totalDiscountWithTaxAmount BIGDECIMAL null,
	totalWithTaxAmount BIGDECIMAL null,
	transactionId TEXT null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null
);

create table CommerceOrderItem (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commerceOrderItemId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	CIBookedQuantityId LONG,
	commerceOrderId LONG,
	commercePriceListId LONG,
	CPInstanceId LONG,
	CPMeasurementUnitId LONG,
	CProductId LONG,
	customerCommerceOrderItemId LONG,
	parentCommerceOrderItemId LONG,
	shippingAddressId LONG,
	deliveryGroup VARCHAR(75) null,
	deliveryMaxSubscriptionCycles LONG,
	deliverySubscriptionLength INTEGER,
	deliverySubscriptionType VARCHAR(75) null,
	deliverySubTypeSettings VARCHAR(75) null,
	depth DOUBLE,
	discountAmount BIGDECIMAL null,
	discountManuallyAdjusted BOOLEAN,
	discountPercentageLevel1 BIGDECIMAL null,
	discountPercentageLevel2 BIGDECIMAL null,
	discountPercentageLevel3 BIGDECIMAL null,
	discountPercentageLevel4 BIGDECIMAL null,
	discountPctLevel1WithTaxAmount BIGDECIMAL null,
	discountPctLevel2WithTaxAmount BIGDECIMAL null,
	discountPctLevel3WithTaxAmount BIGDECIMAL null,
	discountPctLevel4WithTaxAmount BIGDECIMAL null,
	discountWithTaxAmount BIGDECIMAL null,
	finalPrice BIGDECIMAL null,
	finalPriceWithTaxAmount BIGDECIMAL null,
	freeShipping BOOLEAN,
	height DOUBLE,
	json TEXT null,
	manuallyAdjusted BOOLEAN,
	maxSubscriptionCycles LONG,
	name STRING null,
	priceManuallyAdjusted BOOLEAN,
	priceOnApplication BOOLEAN,
	printedNote STRING null,
	promoPrice BIGDECIMAL null,
	promoPriceWithTaxAmount BIGDECIMAL null,
	quantity BIGDECIMAL null,
	replacedCPInstanceId LONG,
	replacedSku VARCHAR(75) null,
	requestedDeliveryDate DATE null,
	shipSeparately BOOLEAN,
	shippable BOOLEAN,
	shippedQuantity BIGDECIMAL null,
	shippingExtraPrice DOUBLE,
	sku VARCHAR(75) null,
	subscription BOOLEAN,
	subscriptionLength INTEGER,
	subscriptionType VARCHAR(75) null,
	subscriptionTypeSettings VARCHAR(75) null,
	UOMIncrementalOrderQuantity BIGDECIMAL null,
	unitOfMeasureKey VARCHAR(75) null,
	unitPrice BIGDECIMAL null,
	unitPriceWithTaxAmount BIGDECIMAL null,
	weight DOUBLE,
	width DOUBLE
);

create table CommerceOrderNote (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commerceOrderNoteId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceOrderId LONG,
	content STRING null,
	restricted BOOLEAN
);

create table CommerceOrderPayment (
	mvccVersion LONG default 0 not null,
	commerceOrderPaymentId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceOrderId LONG,
	commercePaymentMethodKey VARCHAR(75) null,
	content TEXT null,
	status INTEGER
);

create table CommerceOrderType (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commerceOrderTypeId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	name STRING null,
	description STRING null,
	active_ BOOLEAN,
	displayDate DATE null,
	displayOrder INTEGER,
	expirationDate DATE null,
	lastPublishDate DATE null,
	status INTEGER,
	statusByUserId LONG,
	statusByUserName VARCHAR(75) null,
	statusDate DATE null
);

create table CommerceOrderTypeRel (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commerceOrderTypeRelId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	classNameId LONG,
	classPK LONG,
	commerceOrderTypeId LONG
);

create table CommerceShipment (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commerceShipmentId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceAccountId LONG,
	commerceAddressId LONG,
	commerceShippingMethodId LONG,
	carrier VARCHAR(75) null,
	expectedDate DATE null,
	shippingDate DATE null,
	shippingOptionName TEXT null,
	trackingNumber VARCHAR(75) null,
	trackingURL STRING null,
	status INTEGER
);

create table CommerceShipmentItem (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	commerceShipmentItemId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceShipmentId LONG,
	commerceOrderItemId LONG,
	commerceInventoryWarehouseId LONG,
	quantity BIGDECIMAL null,
	unitOfMeasureKey VARCHAR(75) null
);

create table CommerceShippingMethod (
	mvccVersion LONG default 0 not null,
	commerceShippingMethodId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	name STRING null,
	description STRING null,
	active_ BOOLEAN,
	engineKey VARCHAR(75) null,
	imageId LONG,
	priority DOUBLE,
	trackingURL STRING null,
	typeSettings TEXT null
);

create table CommerceSubscriptionEntry (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	commerceSubscriptionEntryId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	CPInstanceUuid VARCHAR(75) null,
	CProductId LONG,
	commerceOrderItemId LONG,
	subscriptionLength INTEGER,
	subscriptionType VARCHAR(75) null,
	subscriptionTypeSettings TEXT null,
	currentCycle LONG,
	maxSubscriptionCycles LONG,
	subscriptionStatus INTEGER,
	lastIterationDate DATE null,
	nextIterationDate DATE null,
	startDate DATE null,
	deliverySubscriptionLength INTEGER,
	deliverySubscriptionType VARCHAR(75) null,
	deliverySubTypeSettings VARCHAR(75) null,
	deliveryCurrentCycle LONG,
	deliveryMaxSubscriptionCycles LONG,
	deliverySubscriptionStatus INTEGER,
	deliveryLastIterationDate DATE null,
	deliveryNextIterationDate DATE null,
	deliveryStartDate DATE null
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create unique index IX_17D56F1B on CPDAvailabilityEstimate (CProductId);
create index IX_E560850D on CPDAvailabilityEstimate (commerceAvailabilityEstimateId);
create index IX_109320B4 on CPDAvailabilityEstimate (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_C37B844F on CPDefinitionInventory (ctCollectionId, CPDefinitionId);
create unique index IX_6C4F2D3A on CPDefinitionInventory (uuid_[$COLUMN_LENGTH:75$], ctCollectionId, groupId);

create unique index IX_4F4C712A on CSOptionAccountEntryRel (accountEntryId, commerceChannelId);
create index IX_B48AB5E on CSOptionAccountEntryRel (commerceChannelId);
create index IX_64B9CFFC on CSOptionAccountEntryRel (commerceShippingOptionKey[$COLUMN_LENGTH:75$]);

create unique index IX_9DD3ABD3 on CommerceAddressRestriction (classNameId, classPK, countryId);
create index IX_AE21488 on CommerceAddressRestriction (countryId);

create index IX_72527224 on CommerceAvailabilityEstimate (companyId);
create index IX_B83AF5B0 on CommerceAvailabilityEstimate (uuid_[$COLUMN_LENGTH:75$]);

create index IX_12131FC1 on CommerceOrder (billingAddressId);
create index IX_4650BB0A on CommerceOrder (commerceAccountId, orderStatus, createDate);
create unique index IX_30FF90A4 on CommerceOrder (externalReferenceCode[$COLUMN_LENGTH:75$], companyId);
create index IX_4F4CAEE4 on CommerceOrder (groupId, commerceAccountId, orderStatus);
create index IX_9C04F6F8 on CommerceOrder (groupId, commercePaymentMethodKey[$COLUMN_LENGTH:75$]);
create index IX_2F8AA139 on CommerceOrder (groupId, orderStatus, userId);
create unique index IX_25C927E3 on CommerceOrder (groupId, uuid_[$COLUMN_LENGTH:75$]);
create index IX_7759000F on CommerceOrder (orderStatus, userId, createDate);
create index IX_4B11FAD8 on CommerceOrder (shippingAddressId);
create index IX_EFAA753 on CommerceOrder (userId);
create index IX_35A4137B on CommerceOrder (uuid_[$COLUMN_LENGTH:75$]);

create index IX_654BB574 on CommerceOrderItem (CIBookedQuantityId);
create index IX_2E1BB39D on CommerceOrderItem (CPInstanceId);
create index IX_F9E8D927 on CommerceOrderItem (CProductId);
create index IX_415AF3E3 on CommerceOrderItem (commerceOrderId, CPInstanceId);
create index IX_15B37023 on CommerceOrderItem (commerceOrderId, subscription);
create index IX_F0E98FC7 on CommerceOrderItem (customerCommerceOrderItemId);
create unique index IX_FA3620D7 on CommerceOrderItem (externalReferenceCode[$COLUMN_LENGTH:75$], companyId);
create index IX_8E1472FB on CommerceOrderItem (parentCommerceOrderItemId);
create unique index IX_F0116282 on CommerceOrderItem (uuid_[$COLUMN_LENGTH:75$], groupId);

create index IX_CEB86C22 on CommerceOrderNote (commerceOrderId, restricted);
create unique index IX_D75F9236 on CommerceOrderNote (externalReferenceCode[$COLUMN_LENGTH:75$], companyId);
create unique index IX_76D9BDA1 on CommerceOrderNote (uuid_[$COLUMN_LENGTH:75$], groupId);

create index IX_CF274005 on CommerceOrderPayment (commerceOrderId);

create index IX_72C90BD4 on CommerceOrderType (companyId, active_);
create unique index IX_4EC1CAC8 on CommerceOrderType (companyId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_B535907 on CommerceOrderType (status, displayDate);
create index IX_4EE2A8A on CommerceOrderType (status, expirationDate);
create index IX_FAD246E1 on CommerceOrderType (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_1110AF1B on CommerceOrderTypeRel (commerceOrderTypeId, classNameId, classPK);
create unique index IX_AD1B97D on CommerceOrderTypeRel (externalReferenceCode[$COLUMN_LENGTH:75$], companyId);
create index IX_D24B6642 on CommerceOrderTypeRel (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_DD20F446 on CommerceShipment (externalReferenceCode[$COLUMN_LENGTH:75$], companyId);
create index IX_616BDD15 on CommerceShipment (groupId, commerceAddressId);
create index IX_68FBA2B5 on CommerceShipment (groupId, status);
create unique index IX_88139005 on CommerceShipment (groupId, uuid_[$COLUMN_LENGTH:75$]);
create index IX_67979D19 on CommerceShipment (uuid_[$COLUMN_LENGTH:75$]);

create index IX_3615B923 on CommerceShipmentItem (commerceOrderItemId);
create unique index IX_4FAC36D0 on CommerceShipmentItem (commerceShipmentId, commerceOrderItemId, commerceInventoryWarehouseId);
create unique index IX_29D8E379 on CommerceShipmentItem (externalReferenceCode[$COLUMN_LENGTH:75$], companyId);
create index IX_DB0BB83C on CommerceShipmentItem (groupId);
create unique index IX_D8C6E9A4 on CommerceShipmentItem (uuid_[$COLUMN_LENGTH:75$], groupId);

create index IX_42E5F6EF on CommerceShippingMethod (groupId, active_);
create unique index IX_C4557F93 on CommerceShippingMethod (groupId, engineKey[$COLUMN_LENGTH:75$]);

create unique index IX_D7D137B1 on CommerceSubscriptionEntry (commerceOrderItemId);
create index IX_43E6F382 on CommerceSubscriptionEntry (companyId, userId);
create index IX_B99DE058 on CommerceSubscriptionEntry (groupId, companyId, userId);
create index IX_B496E103 on CommerceSubscriptionEntry (subscriptionStatus);
create unique index IX_943E0A56 on CommerceSubscriptionEntry (uuid_[$COLUMN_LENGTH:75$], groupId);]]></indexes-sql>
</data>