
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSTOCKENTRY' AND KSQL_COL_NAME ='FPMATERIALID') 
 ALTER TABLE T_POM_MROSTOCKENTRY ADD (FPMATERIALID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSTOCKENTRY' AND KSQL_COL_NAME ='FISJUMPLEVEL') 
 ALTER TABLE T_POM_MROSTOCKENTRY ADD (FISJUMPLEVEL CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_XMANUSTOCKENTRY' AND KSQL_COL_NAME ='FPMATERIALID') 
 ALTER TABLE T_POM_XMANUSTOCKENTRY ADD (FPMATERIALID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_XMANUSTOCKENTRY' AND KSQL_COL_NAME ='FISJUMPLEVEL') 
 ALTER TABLE T_POM_XMANUSTOCKENTRY ADD (FISJUMPLEVEL CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MANUSTOCKENTRY' AND KSQL_COL_NAME ='FPMATERIALID') 
 ALTER TABLE T_POM_MANUSTOCKENTRY ADD (FPMATERIALID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MANUSTOCKENTRY' AND KSQL_COL_NAME ='FISJUMPLEVEL') 
 ALTER TABLE T_POM_MANUSTOCKENTRY ADD (FISJUMPLEVEL CHAR(1) DEFAULT '0' NOT NULL );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_XMFSCHANGELOG_SFEID') CREATE INDEX IDX_POM_XMFSCHANGELOG_SFEID ON T_POM_XMFSTOCKCHANGELOG ( FSTOCKCHANGEENTRYID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_XMFSCHANGELOG_SEID') CREATE INDEX IDX_POM_XMFSCHANGELOG_SEID ON T_POM_XMFSTOCKCHANGELOG ( FSTOCKENTRYID );
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_XMFSTOCKENTRY_STOCKNO') CREATE INDEX IDX_POM_XMFSTOCKENTRY_STOCKNO ON T_POM_XMANUSTOCKENTRY_B ( FSTOCKNO );