/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MRP_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PRODUCTION_DATAFIX' AND KSQL_COL_NAME ='FDEMANDMODEL') 
 ALTER TABLE T_MRP_PRODUCTION_DATAFIX ADD (FDEMANDMODEL NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_RPT_SCHEME_TIME' AND KSQL_COL_NAME ='FISSUMLATEST') 
 ALTER TABLE T_MRP_RPT_SCHEME_TIME ADD (FISSUMLATEST CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_RPT_SCHEME_INV' AND KSQL_COL_NAME ='FFIELDTYPE') 
 ALTER TABLE T_MRP_RPT_SCHEME_INV ADD (FFIELDTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_RPT_SCHEME_INV' AND KSQL_COL_NAME ='FORDERSOURCE') 
 ALTER TABLE T_MRP_RPT_SCHEME_INV ADD (FORDERSOURCE BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_DECUMENTS_DATAFIX' AND KSQL_COL_NAME ='FENTRY_MODIFYTIME') 
 ALTER TABLE T_MRP_DECUMENTS_DATAFIX ADD (FENTRY_MODIFYTIME DATETIME );

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