--Order 20011234.60


ALTER TABLE MISCELLANEOUSCHARGE ADD
(
	REASONCODE_ID        NUMBER NULL ,
	CREATIONUSER_ID      NUMBER DEFAULT  0  NOT NULL ,
	CREATIONTIMESTAMP    DATE NULL 
);


COMMENT ON COLUMN MISCELLANEOUSCHARGE.CREATIONUSER_ID IS 'Not a foreign key.';


ALTER TABLE MISCELLANEOUSCHARGE
ADD CONSTRAINT MISCELLANEOUSCHARGE_REASONCODE FOREIGN KEY (REASONCODE_ID) REFERENCES REASONCODE (REASONCODE_ID);


CREATE INDEX XIF6MISCELLANEOUSCHARGE ON MISCELLANEOUSCHARGE
(
  REASONCODE_ID ASC
)
TABLESPACE INDX;


update miscellaneouscharge m set m.creationtimestamp = m.timestamp;

commit;


ALTER TABLE MISCELLANEOUSCHARGE MODIFY(CREATIONTIMESTAMP NOT NULL);

