/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MAL_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MAL_COMPGROUP' AND KSQL_COL_NAME ='FISNEW') 
 ALTER TABLE T_MAL_COMPGROUP ADD (FISNEW CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MAL_COMPONENT' AND KSQL_COL_NAME ='FISNEW') 
 ALTER TABLE T_MAL_COMPONENT ADD (FISNEW CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MAL_COMPCONFIG' AND KSQL_COL_NAME ='FISNEW') 
 ALTER TABLE T_MAL_COMPCONFIG ADD (FISNEW CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_MAL_APIMESSAGE') 
 CREATE TABLE T_MAL_APIMESSAGE (
FID BIGINT DEFAULT 0 NOT NULL,
FSYSTYPE CHAR(1) DEFAULT ' ' NOT NULL,
FMSGID VARCHAR(80) DEFAULT ' ' NOT NULL,
FMSGTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FSTATUS CHAR(1) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMSGTIME DATETIME,
FRESULT NCLOB,
FRESULT_TAG NCLOB,
FRETRYTIMES INT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MAL_EAFSERVICE' AND KSQL_COL_NAME ='FAFSSERVICESTEPNUM') 
 ALTER TABLE T_MAL_EAFSERVICE ADD (FAFSSERVICESTEPNUM VARCHAR(10) DEFAULT ' ' NOT NULL );

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