/**Begin D:\PDM_UPGRADE\PDM1\BCM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_ISSINGLEMAP' AND KSQL_COL_NAME IN ('FSRCREPORTTYPE')) 
 ALTER TABLE T_BCM_ISSINGLEMAP ADD (FSRCREPORTTYPE VARCHAR(200) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_RPASCHEME') 
 CREATE TABLE T_BCM_RPASCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FFILEADDRESS VARCHAR(200) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL,
FSCENARIOID BIGINT DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FREPORTDATA VARCHAR(100) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIYDATE DATETIME,
FRUNROBOT VARCHAR(20) DEFAULT ' ' NOT NULL,
FRPAPROCESS VARCHAR(10) DEFAULT ' ' NOT NULL,
FEXCSTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FTASKID VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROCDESC NVARCHAR(200) DEFAULT ' ' NOT NULL,
FPROCVER VARCHAR(20) DEFAULT ' ' NOT NULL,
FPROCCODE VARCHAR(50) DEFAULT ' ' NOT NULL,
FPROCNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FAGENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FAGENTNAME NVARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_RPASCHEME_L') 
 CREATE TABLE T_BCM_RPASCHEME_L (
FPKID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(500) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ISEXCEIIMPORT') 
 CREATE TABLE T_BCM_ISEXCEIIMPORT (
FID BIGINT DEFAULT 0 NOT NULL,
FMODELID BIGINT DEFAULT 0 NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FFLOATAREA INT DEFAULT 0 NOT NULL,
FSTARTLINE INT DEFAULT 0 NOT NULL,
FENDLINE INT DEFAULT 0 NOT NULL,
FSEQNUM INT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIYDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ISSHEETMAPPING') 
 CREATE TABLE T_BCM_ISSHEETMAPPING (
FID BIGINT DEFAULT 0 NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FSHEETNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FTEMPLATEID BIGINT DEFAULT 0 NOT NULL,
FSEQNUM SMALLINT DEFAULT 0 NOT NULL,
FISFLOAT CHAR(1) DEFAULT '0' NOT NULL,
FMAPPINGSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FEFFECTSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FDISABLEREASON NVARCHAR(500) DEFAULT ' ' NOT NULL,
FPAGEDIM VARCHAR(255) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIYDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ISCELLMAPPINGDATA') 
 CREATE TABLE T_BCM_ISCELLMAPPINGDATA (
FID BIGINT DEFAULT 0 NOT NULL,
FSHEETMAPPINGID BIGINT DEFAULT 0 NOT NULL,
FMAPPINGJSON NCLOB,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATEDATE DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFIYDATE DATETIME
);



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