__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
 WHERE SCRIPT_FILE_NAME = 'FW43040_BPSCHEMA1.SQL'
   AND END_DTTM IS NOT NULL
/
__THEN__

__EXIT__

__ENDIF__


__IF_EXISTS__
SELECT 1
  FROM USER_TABLES
 WHERE TABLE_NAME = 'F1_INSTALLATION'
/
__ELSE__

__EXIT__

__ENDIF__


__IF_EXISTS__
SELECT 1
  FROM USER_TABLES
 WHERE TABLE_NAME = 'F1_MIGR_REQ'
/
__ELSE__

__EXIT__

__ENDIF__


__IF_EXISTS__
SELECT 1
  FROM USER_TAB_COLUMNS
 WHERE TABLE_NAME = 'F1_MIGR_REQ'
   AND COLUMN_NAME = 'MIGR_REQ_CLASS_FLG'
/

__ELSE__

ALTER TABLE F1_MIGR_REQ ADD 
 (
  MIGR_REQ_CLASS_FLG CHAR(4) NULL
 )
/

UPDATE F1_MIGR_REQ SET MIGR_REQ_CLASS_FLG = 'F1AL' WHERE MIGR_REQ_CLASS_FLG IS NULL
/


ALTER TABLE F1_MIGR_REQ MODIFY
(
     MIGR_REQ_CLASS_FLG NOT NULL
)
/

__ENDIF__