/**Begin D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FFIELDID')
 ALTER TABLE T_BCM_BDCONFIG ADD (FFIELDID VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FFIELDNUMBER') 
 ALTER TABLE T_BCM_BDCONFIG ADD (FFIELDNUMBER VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FFIELDNAME') 
 ALTER TABLE T_BCM_BDCONFIG ADD (FFIELDNAME VARCHAR(100) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_BCM_BDCONFIG ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FCREATETIME') 
 ALTER TABLE T_BCM_BDCONFIG ADD (FCREATETIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_BCM_BDCONFIG ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FMODIFIEDTIME') 
 ALTER TABLE T_BCM_BDCONFIG ADD (FMODIFIEDTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FBELONGAPP') 
 ALTER TABLE T_BCM_BDCONFIG ADD (FBELONGAPP VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FBELONGCLOUD') 
 ALTER TABLE T_BCM_BDCONFIG ADD (FBELONGCLOUD VARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FISSYS') 
 ALTER TABLE T_BCM_BDCONFIG ADD (FISSYS CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDCONFIG' AND KSQL_COL_NAME ='FISENABLE') 
 ALTER TABLE T_BCM_BDCONFIG ADD (FISENABLE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDMAPPING' AND KSQL_COL_NAME ='FPUBMAPPINGID') 
 ALTER TABLE T_BCM_BDMAPPING ADD (FPUBMAPPINGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_ISSINGLEMAP' AND KSQL_COL_NAME ='FPUBMAPPINGID') 
 ALTER TABLE T_BCM_ISSINGLEMAP ADD (FPUBMAPPINGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_BDMAPPINGENTRY' AND KSQL_COL_NAME ='FCUSNAME') 
 ALTER TABLE T_BCM_BDMAPPINGENTRY ADD (FCUSNAME VARCHAR(50) DEFAULT ' ' NOT NULL );

/**End D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_table.sql **/
