--Order 20015159.130

---DATABASESCRIPTEXECUTION table---

ALTER TABLE DATABASESCRIPTEXECUTION ADD (REFERENCE VARCHAR2(50) NULL);
ALTER TABLE DATABASESCRIPTEXECUTION ADD (COMMENTS VARCHAR2(500) NULL);
ALTER TABLE DATABASESCRIPTEXECUTION ADD (SCRIPT CLOB NULL);

COMMENT ON COLUMN DATABASESCRIPTEXECUTION.SCRIPT
  IS 'Contains the executed script';
  
UPDATE DATABASESCRIPTEXECUTION DSE
SET DSE.SCRIPT = (SELECT SCRIPT FROM DATABASESCRIPT DS
WHERE DS.DATABASESCRIPT_ID = DSE.DATABASESCRIPT_ID);
  
commit;

ALTER TABLE DATABASESCRIPTEXECUTION MODIFY (SCRIPT NOT NULL);

---SYSTEMUSER table---
ALTER TABLE SYSTEMUSER ADD (MAYRUNDBSCRIPTS VARCHAR2(1) DEFAULT 'Y' NOT NULL);

COMMENT ON COLUMN SYSTEMUSER.MAYRUNDBSCRIPTS
  IS 'Indicates whether the user is authorized to run incidental database scripts and manually run scheduled processes.';
 
ALTER TABLE SYSTEMUSER
  ADD CONSTRAINT YN_VALIDATIONFIELD236
  CHECK (MAYRUNDBSCRIPTS IN ('Y','N'));