/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_SCHEMEEXECUTEREC' AND KSQL_COL_NAME ='FENDTIME') 
 ALTER TABLE T_BCM_SCHEMEEXECUTEREC ADD (FENDTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_BIZRULESCOPE') 
 CREATE TABLE T_BCM_BIZRULESCOPE (
FID BIGINT DEFAULT 0 NOT NULL,
FBIZRULEID BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONID BIGINT DEFAULT 0 NOT NULL,
FMEMBERID BIGINT DEFAULT 0 NOT NULL,
FSCOPE INT DEFAULT 0 NOT NULL,
FPROPID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_MODELOLAP_RECORD') 
 CREATE TABLE T_BCM_MODELOLAP_RECORD (
FID BIGINT DEFAULT 0 NOT NULL,
FMODEL BIGINT DEFAULT 0 NOT NULL,
FRUNMODEL INT DEFAULT 0 NOT NULL,
FCREATERFIELD BIGINT DEFAULT 0 NOT NULL,
FCREATEDATEFIELD DATETIME,
FRUNDETAILS NVARCHAR(2000) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ISEASMAP') 
 CREATE TABLE T_BCM_ISEASMAP (
FID BIGINT DEFAULT 0 NOT NULL,
FEASNAME VARCHAR(200) DEFAULT ' ' NOT NULL,
FMEMBERID BIGINT DEFAULT 0 NOT NULL,
FMEMBERNUMBER VARCHAR(200) DEFAULT ' ' NOT NULL,
FTMPNUMBER VARCHAR(200) DEFAULT ' ' NOT NULL,
FTMPNAME VARCHAR(200) DEFAULT ' ' NOT NULL,
FDIMENSION BIGINT DEFAULT 0 NOT NULL,
FDIMENSIONNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FPARENTID BIGINT DEFAULT 0 NOT NULL,
FPARENTNUMBER VARCHAR(200) DEFAULT ' ' NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_table.sql **/
