__IF_EXISTS__
SELECT 1
  FROM CI_UT_INSTL_DTL
 WHERE SCRIPT_FILE_NAME = 'FW45001_BPSCHEMA_OUAF-41349.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_BATCH_RUN_ANALYTICS_SNAP'
/
__ELSE__
__EXIT__
__ENDIF__

__IF_EXISTS__
SELECT 1  FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'F1_BATCH_RUN_ANALYTICS_SNAP' AND COLUMN_NAME = 'ELAPSED_TIME'
/
__THEN__

alter table F1_BATCH_RUN_ANALYTICS_SNAP rename column ELAPSED_TIME to ELAPSED_SECS
/
__ELSE__
__ENDIF__


__IF_EXISTS__
SELECT 1 FROM USER_TABLES WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP'
/
__ELSE__
__EXIT__
__ENDIF__

__IF_EXISTS__
SELECT 1  FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP' AND COLUMN_NAME = 'JOB_START_MINS'
/
__THEN__

alter table F1_BATCH_THD_ANALYTICS_SNAP drop column JOB_START_MINS
/
__ELSE__
__ENDIF__


__IF_EXISTS__
SELECT 1 FROM USER_TABLES WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP'
/
__ELSE__
__EXIT__
__ENDIF__

__IF_EXISTS__
SELECT 1  FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP' AND COLUMN_NAME = 'JOB_END_MINS'
/
__THEN__

alter table F1_BATCH_THD_ANALYTICS_SNAP drop column JOB_END_MINS
/
__ELSE__
__ENDIF__


__IF_EXISTS__
SELECT 1 FROM USER_TABLES WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP'
/
__ELSE__
__EXIT__
__ENDIF__

__IF_EXISTS__
SELECT 1  FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP' AND COLUMN_NAME = 'JOB_TOTAL_MINS'
/
__THEN__

alter table F1_BATCH_THD_ANALYTICS_SNAP drop column JOB_TOTAL_MINS 
/
__ELSE__
__ENDIF__


__IF_EXISTS__
SELECT 1 FROM USER_TABLES WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP'
/
__ELSE__
__EXIT__
__ENDIF__

__IF_EXISTS__
SELECT 1  FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP' AND COLUMN_NAME = 'START_DTTM'
/
__THEN__

alter table F1_BATCH_THD_ANALYTICS_SNAP modify (START_DTTM   date)
/
__ELSE__
__ENDIF__


__IF_EXISTS__
SELECT 1 FROM USER_TABLES WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP'
/
__ELSE__
__EXIT__
__ENDIF__

__IF_EXISTS__
SELECT 1  FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP' AND COLUMN_NAME = 'END_DTTM'
/
__THEN__

alter table F1_BATCH_THD_ANALYTICS_SNAP modify (END_DTTM   date)
/
__ELSE__
__ENDIF__


__IF_EXISTS__
SELECT 1 FROM USER_TABLES WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP'
/
__ELSE__
__EXIT__
__ENDIF__

__IF_EXISTS__
SELECT 1  FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'F1_BATCH_THD_ANALYTICS_SNAP' AND COLUMN_NAME = 'CRE_DTTM'
/
__THEN__

alter table F1_BATCH_THD_ANALYTICS_SNAP modify (CRE_DTTM   date)
/
__ELSE__
__ENDIF__




__IF_EXISTS__
SELECT 1 FROM USER_TABLES WHERE TABLE_NAME = 'F1_BATCH_RUN_ANALYTICS_SNAP'
/
__ELSE__
__EXIT__
__ENDIF__

__IF_EXISTS__
SELECT 1  FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'F1_BATCH_RUN_ANALYTICS_SNAP' AND COLUMN_NAME = 'START_DTTM'
/
__THEN__

alter table F1_BATCH_RUN_ANALYTICS_SNAP modify (START_DTTM   date)
/
__ELSE__
__ENDIF__


__IF_EXISTS__
SELECT 1 FROM USER_TABLES WHERE TABLE_NAME = 'F1_BATCH_RUN_ANALYTICS_SNAP'
/
__ELSE__
__EXIT__
__ENDIF__

__IF_EXISTS__
SELECT 1  FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'F1_BATCH_RUN_ANALYTICS_SNAP' AND COLUMN_NAME = 'END_DTTM'
/
__THEN__

alter table F1_BATCH_RUN_ANALYTICS_SNAP modify (END_DTTM   date)
/
__ELSE__
__ENDIF__


__IF_EXISTS__
SELECT 1 FROM USER_TABLES WHERE TABLE_NAME = 'F1_BATCH_RUN_ANALYTICS_SNAP'
/
__ELSE__
__EXIT__
__ENDIF__

__IF_EXISTS__
SELECT 1  FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'F1_BATCH_RUN_ANALYTICS_SNAP' AND COLUMN_NAME = 'CRE_DTTM'
/
__THEN__

alter table F1_BATCH_RUN_ANALYTICS_SNAP modify (CRE_DTTM   date)
/
__ELSE__
__ENDIF__

