/**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_PLS_DETAIL_ENTRY' AND KSQL_COL_NAME ='FWORKSHOPID') 
 ALTER TABLE T_MRP_PLS_DETAIL_ENTRY ADD (FWORKSHOPID BIGINT DEFAULT 0 NOT NULL );
 --排程明细分录表增加班次字段
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLS_DETAIL_ENTRY' AND KSQL_COL_NAME ='FWORKSHIFTID') 
 ALTER TABLE T_MRP_PLS_DETAIL_ENTRY ADD (FWORKSHIFTID BIGINT DEFAULT 0 NOT NULL );
 --排程结果表增加车间字段
 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLS_RESULT' AND KSQL_COL_NAME ='FWORKSHOPID') 
 ALTER TABLE T_MRP_PLS_RESULT ADD (FWORKSHOPID BIGINT DEFAULT 0 NOT NULL );
  --排程结果表增加班次字段
  IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLS_RESULT' AND KSQL_COL_NAME ='FWORKSHIFTID') 
 ALTER TABLE T_MRP_PLS_RESULT ADD (FWORKSHIFTID BIGINT DEFAULT 0 NOT NULL );

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