/**Begin D:\PDM_UPGRADE\PDM1\IFM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_INNERACCT' AND KSQL_COL_NAME IN ('FISDRAWOBJECT'))
 ALTER TABLE T_IFM_INNERACCT ADD (FISDRAWOBJECT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_INTBILL_BATCH_L' AND KSQL_COL_NAME IN ('FCOMMENT'))
 ALTER TABLE T_IFM_INTBILL_BATCH_L ADD (FCOMMENT NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_INTBILL_BATCH' AND KSQL_COL_NAME IN ('FCOMMENT'))
 ALTER TABLE T_IFM_INTBILL_BATCH ADD (FCOMMENT NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_INTBILL_BATCH' AND KSQL_COL_NAME IN ('FDESCRIPTION'))
 ALTER TABLE T_IFM_INTBILL_BATCH ADD (FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IFM_INTOBJECT')
 CREATE TABLE T_IFM_INTOBJECT (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FDISABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLERID BIGINT DEFAULT 0 NOT NULL,
FENABLEDATE DATETIME,
FDISABLEDATE DATETIME,
FINNERACCTID BIGINT DEFAULT 0 NOT NULL,
FSTARTINTDATE DATETIME,
FLASTINTDATE DATETIME,
FINTERESTTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FDATASOURCE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FINTINNERACCTID BIGINT DEFAULT 0 NOT NULL,
FINTERESTWAY NVARCHAR(30) DEFAULT ' ' NOT NULL,
FREFERRATEID BIGINT DEFAULT 0 NOT NULL,
FISCALOVERINT CHAR(1) DEFAULT '0' NOT NULL,
FOVERSIGN NVARCHAR(30) DEFAULT ' ' NOT NULL,
FOVERPOINTS BIGINT DEFAULT 0 NOT NULL,
FCOMMENT NVARCHAR(255) DEFAULT ' ' NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FSETTLECENTERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IFM_INTOBJECT_L')
 CREATE TABLE T_IFM_INTOBJECT_L (
FPKID NVARCHAR(30) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(80) DEFAULT ' ' NOT NULL,
FCOMMENT NVARCHAR(255) DEFAULT ' ' NOT NULL
);


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