/**Begin D:\PDM_UPGRADE\PDM1\BCM_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_INTERGRATION' AND KSQL_COL_NAME IN ('FCELLID')) 
 ALTER TABLE T_BCM_INTERGRATION ADD (FCELLID BIGINT DEFAULT 0 NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_DATACOLLECTLOG' AND KSQL_COL_NAME IN ('FCELLID')) 
 ALTER TABLE T_BCM_DATACOLLECTLOG ADD (FCELLID BIGINT DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_ISSCHEME' AND KSQL_COL_NAME IN ('FSRCMODEL')) 
 ALTER TABLE T_BCM_ISSCHEME ADD (FSRCMODEL BIGINT DEFAULT 0 NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ISNGMODEL') 
 CREATE TABLE T_BCM_ISNGMODEL (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FUSERTYPE VARCHAR(10) DEFAULT '1' NOT NULL,
FUSERTAG VARCHAR(50) DEFAULT ' ' NOT NULL,
FUSERURL VARCHAR(50) DEFAULT ' ' NOT NULL,
FPHONENUMBER VARCHAR(20) DEFAULT ' ' NOT NULL,
FDATASOURCE VARCHAR(20) DEFAULT ' ' NOT NULL,
FDATASOURCENAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAPPTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FMODELSOURCETYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMODELSOURCE BIGINT DEFAULT 0 NOT NULL,
FMODELSOURCENAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FCONNECTTAG VARCHAR(2000) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYDATE DATETIME
);



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