/**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_FLOWTASK' AND KSQL_COL_NAME ='FDATALOCKPLANID') 
 ALTER TABLE T_BCM_FLOWTASK ADD (FDATALOCKPLANID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_FLOWTASK' AND KSQL_COL_NAME ='FLOCKSTAGEID') 
 ALTER TABLE T_BCM_FLOWTASK ADD (FLOCKSTAGEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_STAGECONTROLSTATUS') 
 CREATE TABLE T_BCM_STAGECONTROLSTATUS (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FMERGECONTROLID BIGINT DEFAULT 0 NOT NULL,
FLOCKSTAGEID BIGINT DEFAULT 0 NOT NULL,
FFLOWTASKID BIGINT DEFAULT 0 NOT NULL,
FCHKSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FFLOWSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);



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