-- order 20011656 & order 20011171 (for CUSTOMERACTIVITIES table)


---------------- WORKORDER------------------------
ALTER TABLE WORKORDER
	ADD (INTERNALPROCESSINGBU_ID NUMBER NULL);

CREATE  INDEX XIF25WORKORDER ON WORKORDER
(INTERNALPROCESSINGBU_ID   ASC); 


ALTER TABLE WORKORDER
ADD CONSTRAINT WORKORDER_INTPROCESSINGBU_ID  FOREIGN KEY (INTERNALPROCESSINGBU_ID) REFERENCES BUSINESSUNIT (BUSINESSUNIT_ID);



---------------- PACKINGNOTE------------------------

ALTER TABLE PACKINGNOTE
	ADD (INTERNALPROCESSINGBU_ID NUMBER NULL);

CREATE  INDEX XIF15PACKINGNOTE ON PACKINGNOTE
(INTERNALPROCESSINGBU_ID   ASC); 


ALTER TABLE PACKINGNOTE
ADD CONSTRAINT PACKINGNOTE_INTPROCESSINGBU_ID  FOREIGN KEY (INTERNALPROCESSINGBU_ID) REFERENCES BUSINESSUNIT (BUSINESSUNIT_ID);



---------------- CUSTOMERACTIVITIES ------------------------

ALTER TABLE CUSTOMERACTIVITIES
	ADD (INTERNALPROCESSINGBU_ID NUMBER NULL);

CREATE  INDEX XIF7CUSTOMERACTIVITIES ON CUSTOMERACTIVITIES
(INTERNALPROCESSINGBU_ID   ASC); 


ALTER TABLE CUSTOMERACTIVITIES
ADD CONSTRAINT CUSTOMERACTIV_INTPROCESSBU_ID FOREIGN KEY (INTERNALPROCESSINGBU_ID) REFERENCES BUSINESSUNIT (BUSINESSUNIT_ID);
