/**Begin D:\PDM_UPGRADE\PDM1\TSRBD_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TSRBD_OFFERTEMPLATE' AND KSQL_COL_NAME ='FSALARYDETTYPE') 
 ALTER TABLE T_TSRBD_OFFERTEMPLATE ADD (FSALARYDETTYPE VARCHAR(10) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TSRBD_CFGMSGTEMPLATE' AND KSQL_COL_NAME ='FSENDTYPE') 
 ALTER TABLE T_TSRBD_CFGMSGTEMPLATE ADD (FSENDTYPE VARCHAR(10) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_MSGTEMPFLDSCM_L') 
 CREATE TABLE T_TSRBD_MSGTEMPFLDSCM_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_MSGTEMPFLDSCM') 
 CREATE TABLE T_TSRBD_MSGTEMPFLDSCM (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSALARYDETTYPE VARCHAR(10) DEFAULT ' ' NOT NULL,
FTEMPTYPE BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_FLDSCMENTRY') 
 CREATE TABLE T_TSRBD_FLDSCMENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FOFFERFIELD BIGINT DEFAULT 0 NOT NULL,
FISENCRYPTION CHAR(1) DEFAULT '0' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_MSGTEMPTYPE_L') 
 CREATE TABLE T_TSRBD_MSGTEMPTYPE_L (
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_MSGTEMPTYPE') 
 CREATE TABLE T_TSRBD_MSGTEMPTYPE (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT ' ' NOT NULL,
FENABLE VARCHAR(2) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_TSRBD_TEMPTYPEENTRY') 
 CREATE TABLE T_TSRBD_TEMPTYPEENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FFIELDCLOUD VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDSERVICE VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDMETHOD VARCHAR(50) DEFAULT ' ' NOT NULL,
FVALUECLOUD VARCHAR(50) DEFAULT ' ' NOT NULL,
FVALUESERVICE VARCHAR(50) DEFAULT ' ' NOT NULL,
FVALUEMETHOD VARCHAR(50) DEFAULT ' ' NOT NULL,
FGROUPKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL
);



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