
--计划调度方案 增加工程变更评估运算相关字段
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANDISPATCH' AND KSQL_COL_NAME ='FECOPLANORGID')
ALTER TABLE T_MRP_PLANDISPATCH ADD (FECOPLANORGID BIGINT DEFAULT 0 NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANDISPATCH_E' AND KSQL_COL_NAME ='FECOSCHEMENUMBER')
ALTER TABLE T_MRP_PLANDISPATCH_E ADD (FECOSCHEMENUMBER NVARCHAR(255)   DEFAULT  ' '  NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANDISPATCH_E' AND KSQL_COL_NAME ='FECOSCHEMENAME')
ALTER TABLE T_MRP_PLANDISPATCH_E ADD (FECOSCHEMENAME NVARCHAR(255)   DEFAULT  ' '  NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANDISPATCH_E' AND KSQL_COL_NAME ='FECOSCHEMEID')
ALTER TABLE T_MRP_PLANDISPATCH_E ADD (FECOSCHEMEID NVARCHAR(255)   DEFAULT  ' '  NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANDISPATCH_E' AND KSQL_COL_NAME ='FECORUNLOGID')
ALTER TABLE T_MRP_PLANDISPATCH_E ADD (FECORUNLOGID NVARCHAR(255)   DEFAULT  ' '  NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_MRP_PLANDISPATCH_E' AND KSQL_COL_NAME ='FECORUNSTATUS')
ALTER TABLE T_MRP_PLANDISPATCH_E ADD (FECORUNSTATUS NVARCHAR(30)   DEFAULT  ' '  NOT NULL);
