/**Begin D:\PDM_UPGRADE\PDM1\IFM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_INTOBJECT' AND KSQL_COL_NAME IN ('FACCOUNTORGID')) 
 ALTER TABLE T_IFM_INTOBJECT ADD (FACCOUNTORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_INTOBJECT' AND KSQL_COL_NAME IN ('FINTOBJECTID')) 
 ALTER TABLE T_IFM_INTOBJECT ADD (FINTOBJECTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_INTOBJECT' AND KSQL_COL_NAME IN ('FCURRENCYID')) 
 ALTER TABLE T_IFM_INTOBJECT ADD (FCURRENCYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_INTOBJECT' AND KSQL_COL_NAME IN ('FBIZTYPE')) 
 ALTER TABLE T_IFM_INTOBJECT ADD (FBIZTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_INTOBJECT' AND KSQL_COL_NAME IN ('FRELATEITEM')) 
 ALTER TABLE T_IFM_INTOBJECT ADD (FRELATEITEM CHAR(1) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_INTBILL_BATCH' AND KSQL_COL_NAME IN ('FINTSOURCE')) 
 ALTER TABLE T_IFM_INTBILL_BATCH ADD (FINTSOURCE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_CURRENTINTBILL' AND KSQL_COL_NAME IN ('FINTSOURCE')) 
 ALTER TABLE T_IFM_CURRENTINTBILL ADD (FINTSOURCE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_IFM_CURRENTINTBILL' AND KSQL_COL_NAME IN ('FINTOBJECTID')) 
 ALTER TABLE T_IFM_CURRENTINTBILL ADD (FINTOBJECTID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_IFM_INTOBJECT_ENTRY') 
 CREATE TABLE T_IFM_INTOBJECT_ENTRY (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSELECT CHAR(1) DEFAULT ' ' NOT NULL,
FASSTACTITEMID BIGINT DEFAULT 0 NOT NULL,
FDETAILID BIGINT DEFAULT 0 NOT NULL,
FDETAIL NVARCHAR(255) DEFAULT ' ' NOT NULL
);

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

