/**Begin C:\Users\rd_jin_gu\Documents\work\PDM_UPGRADE\PDM1\HRCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_MSGCENTERENTRY' AND KSQL_COL_NAME ='FEXCEPTIONFEEDBACK') 
 ALTER TABLE T_HRCS_MSGCENTERENTRY ADD (FEXCEPTIONFEEDBACK VARCHAR(10) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HRCS_MSGCENTERENTRY' AND KSQL_COL_NAME ='FEXCEPTIONFEEDBACKDESC') 
 ALTER TABLE T_HRCS_MSGCENTERENTRY ADD (FEXCEPTIONFEEDBACKDESC NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGEXCEPTIONLOG') 
 CREATE TABLE T_HRCS_MSGEXCEPTIONLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' 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,
FMSGCENTERID BIGINT DEFAULT 0 NOT NULL,
FMSGCENTERENTRYID BIGINT DEFAULT 0 NOT NULL,
FHANDLESTATUS VARCHAR(10) DEFAULT ' ' NOT NULL,
FEXCEPTIONFEEDBACK VARCHAR(10) DEFAULT ' ' NOT NULL,
FEXCEPTIONFEEDBACKDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEXCEPTIONFEEDBACKTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGEXCEPLOGENTRY') 
 CREATE TABLE T_HRCS_MSGEXCEPLOGENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FWARNINGTYPE VARCHAR(2) DEFAULT ' ' NOT NULL,
FWARNINGTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGEXCEPTIONLOG_L') 
 CREATE TABLE T_HRCS_MSGEXCEPTIONLOG_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,
FEXCEPTIONFEEDBACKDESC NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HRCS_MSGCENTERENTRY_L') 
 CREATE TABLE T_HRCS_MSGCENTERENTRY_L (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FEXCEPTIONFEEDBACKDESC NVARCHAR(255) DEFAULT ' ' NOT NULL
);



/**End C:\Users\rd_jin_gu\Documents\work\PDM_UPGRADE\PDM1\HRCS_table.sql **/
