-- order 20010669 (new Lotus Notes), old order no. 502865 


CREATE TABLE PURCHASEORDERADDRESSINFO
(
	PURCHASEORDERHEADER_ID NUMBER NOT NULL ,
	NAME                 VARCHAR2(30) NOT NULL ,
	EXTRANAME1           VARCHAR2(30) NULL ,
	EXTRANAME2           VARCHAR2(30) NULL ,
	CONTACTPERSON        VARCHAR2(30) NULL ,
	STREET1              VARCHAR2(30) NOT NULL ,
	STREET2              VARCHAR2(30) NULL ,
	ZIPCODE              VARCHAR2(30) NOT NULL ,
	CITY                 VARCHAR2(30) NOT NULL ,
        SYSTEMUSER_ID        NUMBER NOT NULL ,
	TIMESTAMP            DATE NOT NULL 
)
TABLESPACE ABS_DATA;


CREATE SEQUENCE SEQ_PURCHASEORDERADDRESSINFO
START WITH 1 
INCREMENT BY 1;


CREATE UNIQUE INDEX XPKPURCHASEORDERADDRESSINFO ON PURCHASEORDERADDRESSINFO
(
PURCHASEORDERHEADER_ID   ASC
)
TABLESPACE INDX;



ALTER TABLE PURCHASEORDERADDRESSINFO
ADD CONSTRAINT  XPKPURCHASEORDERADDRESSINFO PRIMARY KEY (PURCHASEORDERHEADER_ID);



ALTER TABLE PURCHASEORDERADDRESSINFO
ADD CONSTRAINT POHEADER_POHEADERADDRESSINFO FOREIGN KEY (PURCHASEORDERHEADER_ID) REFERENCES PURCHASEORDERHEADER (PURCHASEORDERHEADER_ID) ON DELETE CASCADE;

