

-- Generated by Relational Schema Center on Wed May 05 16:33:31 CDT 2004


CREATE TABLE ASSEMBLYENT
  (ID VARCHAR(250) NOT NULL,
   NAME VARCHAR(250),
   DESCRIPTION VARCHAR(250),
   REVISION VARCHAR(250),
   PLANNER INTEGER NOT NULL,
   TYPE1 INTEGER NOT NULL,
   PURCHASED INTEGER NOT NULL,
   LOMARK INTEGER NOT NULL,
   HIMARK INTEGER NOT NULL,
   INVENTORY_PARTID VARCHAR(250));

ALTER TABLE ASSEMBLYENT
  ADD CONSTRAINT PK_ASSEMBLYENT PRIMARY KEY (ID);

CREATE TABLE BOMENT
  (ASSEMBLYID VARCHAR(250) NOT NULL,
   COMPONENTID VARCHAR(250) NOT NULL,
   LINENO1 INTEGER NOT NULL,
   QTY INTEGER NOT NULL,
   ENGCHANGE VARCHAR(250),
   OPSNO INTEGER NOT NULL,
   OPSDESC VARCHAR(250),
   COMPONENT_ID VARCHAR(250),
   ASSEMBLY_ID VARCHAR(250));

ALTER TABLE BOMENT
  ADD CONSTRAINT PK_BOMENT PRIMARY KEY (ASSEMBLYID, COMPONENTID, LINENO1);

CREATE TABLE COMPONENTENT
  (ID VARCHAR(250) NOT NULL,
   NAME VARCHAR(250),
   DESCRIPTION VARCHAR(250),
   REVISION VARCHAR(250),
   PLANNER INTEGER NOT NULL,
   TYPE1 INTEGER NOT NULL,
   PURCHASED INTEGER NOT NULL,
   LOMARK INTEGER NOT NULL,
   HIMARK INTEGER NOT NULL,
   INVENTORY_PARTID VARCHAR(250));

ALTER TABLE COMPONENTENT
  ADD CONSTRAINT PK_COMPONENTENT PRIMARY KEY (ID);

CREATE TABLE PARTENT
  (ID VARCHAR(250) NOT NULL,
   NAME VARCHAR(250),
   DESCRIPTION VARCHAR(250),
   REVISION VARCHAR(250),
   PLANNER INTEGER NOT NULL,
   TYPE1 INTEGER NOT NULL,
   PURCHASED INTEGER NOT NULL,
   LOMARK INTEGER NOT NULL,
   HIMARK INTEGER NOT NULL);

ALTER TABLE PARTENT
  ADD CONSTRAINT PK_PARTENT PRIMARY KEY (ID);

CREATE TABLE WORKORDERENT
  (ID INTEGER NOT NULL,
   SALESID INTEGER NOT NULL,
   OLINEID INTEGER NOT NULL,
   STATUS INTEGER NOT NULL,
   ORIGQTY INTEGER NOT NULL,
   COMPQTY INTEGER NOT NULL,
   ASSEMBLYID VARCHAR(250),
   DUEDATE DATE,
   STARTDATE TIMESTAMP,
   ASSEMBLY_ID VARCHAR(250));

ALTER TABLE WORKORDERENT
  ADD CONSTRAINT PK_WORKORDERENT PRIMARY KEY (ID);

CREATE TABLE LARGEORDERENT
  (ID INTEGER NOT NULL,
   SALESORDERID INTEGER NOT NULL,
   ORDERLINENUMBER INTEGER NOT NULL,
   ASSEMBLYID VARCHAR(250),
   QTY SMALLINT NOT NULL,
   DUEDATE DATE,
   CATEGORY INTEGER);

ALTER TABLE LARGEORDERENT
  ADD CONSTRAINT PK_LARGEORDERENT PRIMARY KEY (ID);

CREATE TABLE INVENTORYENT
  (PARTID VARCHAR(250) NOT NULL,
   QTY INTEGER NOT NULL,
   LOCATION VARCHAR(250),
   ACCCODE INTEGER NOT NULL,
   ACCDATE DATE,
   IN_ORDERED INTEGER NOT NULL);

ALTER TABLE INVENTORYENT
  ADD CONSTRAINT PK_INVENTORYENT PRIMARY KEY (PARTID);