/**Begin D:\dev\tools\PDM_UPGRADE\pdm1\HAOS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_CHANGEMSG') 
 CREATE TABLE T_HAOS_CHANGEMSG (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(60) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSIMPLENAME NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FISSYSPRESET CHAR(1) DEFAULT '0' NOT NULL,
FADMINORGBOID BIGINT DEFAULT 0 NOT NULL,
FINDEX INT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FDISABLEDATE DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FSTATUS VARCHAR(2) DEFAULT 'C' NOT NULL,
FENABLE VARCHAR(2) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FEFFETDATE DATETIME,
FMSGTITLE VARCHAR(50) DEFAULT ' ' NOT NULL,
FCHANGETYPEID BIGINT DEFAULT 0 NOT NULL,
FCHANGESCENEID BIGINT DEFAULT 0 NOT NULL,
FCHANGEOPERATEID BIGINT DEFAULT 0 NOT NULL,
FCHANGEREASONID BIGINT DEFAULT 0 NOT NULL,
FCHANGEDESC NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCHANGEUSERID BIGINT DEFAULT 0 NOT NULL,
FCHANGETIME DATETIME,
FFAILDESCRIPTION NCLOB,
FFAILDESCRIPTION_TAG NCLOB,
FMSGTAG VARCHAR(50) DEFAULT ' ' NOT NULL,
FMSGDESC VARCHAR(255) DEFAULT ' ' NOT NULL,
FADMINORGID BIGINT DEFAULT 0 NOT NULL,
FSENDSTATE VARCHAR(2) DEFAULT '0' NOT NULL,
FRETRYTIMES INT DEFAULT 0 NOT NULL,
FLASTSENDTIME DATETIME,
FMSGPARAMS NCLOB,
FACTIONID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_HAOS_CHANGEMSGENTRY') 
 CREATE TABLE T_HAOS_CHANGEMSGENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FSUBSCRIBEBDID BIGINT DEFAULT 0 NOT NULL,
FRECSTATUS VARCHAR(2) DEFAULT 'A' NOT NULL,
FCONSUMERCLOUD VARCHAR(36) DEFAULT '0' NOT NULL,
FCONSUMERAPP VARCHAR(36) DEFAULT '0' NOT NULL,
FSOURCETYPE BIGINT DEFAULT 0 NOT NULL
);


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



/**End D:\dev\tools\PDM_UPGRADE\pdm1\HAOS_table.sql **/
