--Order 20014991.80 Full Load Tracking - Utilizing Packers and Loose Linen Packers

begin
execute immediate ('ALTER TABLE ACTIVESTOCKDELIVERY DROP CONSTRAINT DELIVERFROM_valid');
exception when others then null;
end;
/

ALTER TABLE ACTIVESTOCKDELIVERY
  ADD  CONSTRAINT DELIVERFROM_valid  CHECK (DELIVERFROM IN (1, 2, 3, 4));

ALTER TABLE ACTIVESTOCKDELIVERY
  MODIFY SIZEDEFINITION_LINK_ID NUMBER NULL;


begin
execute immediate ('ALTER TABLE UNIQUEIDCONFIGURATION DROP CONSTRAINT PACKAGETYPE_valid');
exception when others then null;
end;
/

ALTER TABLE UNIQUEIDCONFIGURATION
  ADD  CONSTRAINT PACKAGETYPE_valid  CHECK (PACKAGETYPE IN (1, 2, 3, 4, 5, 6, 7, 8, 9));

begin
execute immediate ('ALTER TABLE UNIQUEIDCONFIGURATION DROP CONSTRAINT IDCODEFORMAT_valid');
exception when others then null;
end;
/

ALTER TABLE UNIQUEIDCONFIGURATION
  ADD  CONSTRAINT IDCODEFORMAT_valid  CHECK (IDCODEFORMAT IN (1, 2, 3, 4));


COMMENT ON COLUMN UNIQUEIDCONFIGURATION.IDCODEFORMAT IS '1 = Numeric
2 = Hexadecimal
3 = Alphanumeric
4 = ASCII';

COMMENT ON COLUMN ACTIVESTOCKDELIVERY.DELIVERFROM IS '1 = From Active Stock Locations
2 = From Bulk put up per Route
3 = Standard mat to customer
4 = Packers per Route';

COMMENT ON COLUMN UNIQUEIDCONFIGURATION.PACKAGETYPE IS '1 = Product
2 = Storage Location
3 = Container
4 = Bundle (only available for module license)
5 = Residential/domestic
6 = OR Packs
7 = Carts
8 = Bags
9 = Packers';