<?xml version="1.0"?>

<data>
	<tables-sql><![CDATA[create table CIAudit (
	mvccVersion LONG default 0 not null,
	CIAuditId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	logType VARCHAR(75) null,
	logTypeSettings TEXT null,
	quantity BIGDECIMAL null,
	sku VARCHAR(75) null,
	unitOfMeasureKey VARCHAR(75) null
);

create table CIBookedQuantity (
	mvccVersion LONG default 0 not null,
	CIBookedQuantityId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	bookedNote VARCHAR(75) null,
	expirationDate DATE null,
	quantity BIGDECIMAL null,
	sku VARCHAR(75) null,
	unitOfMeasureKey VARCHAR(75) null
);

create table CIReplenishmentItem (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	CIReplenishmentItemId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceInventoryWarehouseId LONG,
	availabilityDate DATE null,
	quantity BIGDECIMAL null,
	sku VARCHAR(75) null,
	unitOfMeasureKey VARCHAR(75) null
);

create table CIWarehouse (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	CIWarehouseId 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,
	street1 VARCHAR(75) null,
	street2 VARCHAR(75) null,
	street3 VARCHAR(75) null,
	city VARCHAR(75) null,
	zip VARCHAR(75) null,
	commerceRegionCode VARCHAR(75) null,
	countryTwoLettersISOCode VARCHAR(75) null,
	latitude DOUBLE,
	longitude DOUBLE,
	type_ VARCHAR(75) null
);

create table CIWarehouseGroupRel (
	CIWarehouseGroupRelId LONG not null primary key,
	groupId LONG,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceWarehouseId LONG,
	primary_ BOOLEAN
);

create table CIWarehouseItem (
	mvccVersion LONG default 0 not null,
	uuid_ VARCHAR(75) null,
	externalReferenceCode VARCHAR(75) null,
	CIWarehouseItemId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	commerceInventoryWarehouseId LONG,
	quantity BIGDECIMAL null,
	reservedQuantity BIGDECIMAL null,
	sku VARCHAR(75) null,
	unitOfMeasureKey VARCHAR(75) null
);

create table CIWarehouseRel (
	mvccVersion LONG default 0 not null,
	CIWarehouseRelId LONG not null primary key,
	companyId LONG,
	userId LONG,
	userName VARCHAR(75) null,
	createDate DATE null,
	modifiedDate DATE null,
	classNameId LONG,
	classPK LONG,
	CIWarehouseId LONG
);]]></tables-sql>
	<sequences-sql><![CDATA[]]></sequences-sql>
	<indexes-sql><![CDATA[create index IX_45C5C370 on CIAudit (companyId, sku[$COLUMN_LENGTH:75$], unitOfMeasureKey[$COLUMN_LENGTH:75$]);
create index IX_E7D143D9 on CIAudit (createDate);

create index IX_33BF9CB0 on CIBookedQuantity (expirationDate);
create index IX_EB8535EA on CIBookedQuantity (sku[$COLUMN_LENGTH:75$], companyId, unitOfMeasureKey[$COLUMN_LENGTH:75$]);

create index IX_F588314 on CIReplenishmentItem (availabilityDate);
create index IX_967CACA8 on CIReplenishmentItem (commerceInventoryWarehouseId);
create unique index IX_3462AACC on CIReplenishmentItem (companyId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_EBEBFEE2 on CIReplenishmentItem (sku[$COLUMN_LENGTH:75$], companyId, unitOfMeasureKey[$COLUMN_LENGTH:75$]);
create index IX_DA9C2C43 on CIReplenishmentItem (sku[$COLUMN_LENGTH:75$], unitOfMeasureKey[$COLUMN_LENGTH:75$], availabilityDate);
create index IX_B359B95D on CIReplenishmentItem (uuid_[$COLUMN_LENGTH:75$]);

create index IX_331A3FD3 on CIWarehouse (companyId, active_, countryTwoLettersISOCode[$COLUMN_LENGTH:75$]);
create index IX_DADA8974 on CIWarehouse (companyId, countryTwoLettersISOCode[$COLUMN_LENGTH:75$]);
create unique index IX_68E6B8D8 on CIWarehouse (companyId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_3CCB62D1 on CIWarehouse (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_B4413476 on CIWarehouseItem (commerceInventoryWarehouseId, sku[$COLUMN_LENGTH:75$], unitOfMeasureKey[$COLUMN_LENGTH:75$]);
create unique index IX_8A09C40B on CIWarehouseItem (companyId, externalReferenceCode[$COLUMN_LENGTH:75$]);
create index IX_B86B6C8B on CIWarehouseItem (companyId, sku[$COLUMN_LENGTH:75$], unitOfMeasureKey[$COLUMN_LENGTH:75$]);
create index IX_4AD4537E on CIWarehouseItem (uuid_[$COLUMN_LENGTH:75$]);

create unique index IX_A743341B on CIWarehouseRel (CIWarehouseId, classNameId, classPK);]]></indexes-sql>
</data>