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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_ISSCHEME' AND KSQL_COL_NAME IN ('FCUSTOMSERVICE')) 
 ALTER TABLE T_BCM_ISSCHEME ADD (FCUSTOMSERVICE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ISCUSTOMREGISTER')

 CREATE TABLE T_BCM_ISCUSTOMREGISTER (
FID BIGINT DEFAULT 0 NOT NULL,
FCLOUDID VARCHAR(20) DEFAULT ' ' NOT NULL,
FAPPID VARCHAR(20) DEFAULT ' ' NOT NULL,
FSERVICE VARCHAR(50) DEFAULT ' ' NOT NULL,
FMETHOD VARCHAR(50) DEFAULT ' ' NOT NULL,
FCLASSPATH VARCHAR(255) DEFAULT ' ' NOT NULL,
FISENABLE CHAR(1) DEFAULT '1' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_DATACOLLECTRECORD') 
 CREATE TABLE T_BCM_DATACOLLECTRECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FMODEL BIGINT DEFAULT 0 NOT NULL,
FGROUP BIGINT DEFAULT 0 NOT NULL,
FCOUNT INT DEFAULT 0 NOT NULL,
FREMAINDER INT DEFAULT 0 NOT NULL,
FENDTIME DATETIME,
FCREATETIME DATETIME,
FCREATOR BIGINT DEFAULT 0 NOT NULL,
FSCENARIO BIGINT DEFAULT 0 NOT NULL,
FYEAR BIGINT DEFAULT 0 NOT NULL,
FPERIOD BIGINT DEFAULT 0 NOT NULL
);



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