--Order 20011863

---create tables EXTERNALGARMENTTRACKDATA
create table EXTERNALGARMENTTRACKDATA
(
  TRACKID       VARCHAR2(10) not null,
  PLANTCODE     VARCHAR2(6) not null,
  TIMESTAMP     DATE not null,
  TRACKLOCATION VARCHAR2(3) not null
);
-- Create/Recreate primary, unique and foreign key constraints 
alter table EXTERNALGARMENTTRACKDATA
  add constraint PK_EXTERNALGARMENTTRACKDATA primary key (TRACKID, TIMESTAMP, TRACKLOCATION);
-- Create/Recreate indexes 
create index INDX_EXTERNALGARMENTTRCKDT01 on EXTERNALGARMENTTRACKDATA (PLANTCODE);


-- Create table EXTERNALGARMENTSORTDATA
create table EXTERNALGARMENTSORTDATA
(
  GARMENTID              VARCHAR2(10) not null,
  PLANTCODE              VARCHAR2(6) null,
  FOLDDESTINATION        VARCHAR2(1) null,
  FOLDPROGRAM            NUMBER(2) null,
  FINISHERPROGRAM        NUMBER(1) null,
  ROUTEID                VARCHAR2(5) null,
  CUSTOMERID             VARCHAR2(6) null,
  CUSTOMERNAME           VARCHAR2(30) null,
  EMPLOYEEID             VARCHAR2(6) null,
  EMPLOYEENAME           VARCHAR2(25) null,
  SORTCRITERIAINFO       VARCHAR2(40) null,
  OPTIONS1               VARCHAR2(1) null,
  OPTIONS2               VARCHAR2(9) null,
  REPLACE                VARCHAR2(3) null,
  STACKALTERNATECRITERIA VARCHAR2(5) null,
  REPAIRALLOWED          NUMBER(1) null,
  REPAIRCOLOR            NUMBER(3) null,
  INFOTEXT1              VARCHAR2(40) null,
  INFOTEXT2              VARCHAR2(40) null,
  INFOTEXT10             VARCHAR2(10) null,
  STATUSDATE             DATE null,
  TIMESTAMP              DATE null
);
-- Create/Recreate primary, unique and foreign key constraints 
alter table EXTERNALGARMENTSORTDATA
  add constraint PK_EXTERNALGARMENTSORTDATA primary key (GARMENTID);