--BOM版本规则增加数据列
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_BOMVERSIONRULE' AND KSQL_COL_NAME ='FMULTYPE')
ALTER TABLE T_BD_BOMVERSIONRULE ADD (FMULTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_BOMVERSIONRULE' AND KSQL_COL_NAME ='FISDEFAULTROUTE')
ALTER TABLE T_BD_BOMVERSIONRULE ADD (FISDEFAULTROUTE CHAR(1) DEFAULT '0' NOT NULL);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_BOMVERSIONRULE' AND KSQL_COL_NAME ='FISDEFAULTPROGRAME')
ALTER TABLE T_BD_BOMVERSIONRULE ADD (FISDEFAULTPROGRAME CHAR(1) DEFAULT '0' NOT NULL);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_BOMVERSION' AND KSQL_COL_NAME ='FTYPE')
ALTER TABLE T_BD_BOMVERSION ADD (FTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_BOMVERSION' AND KSQL_COL_NAME ='FSRCBILLID')
ALTER TABLE T_BD_BOMVERSION ADD (FSRCBILLID BIGINT DEFAULT 0 NOT NULL);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BD_BOMVERSION' AND KSQL_COL_NAME ='FMATERIALGROUPID')
ALTER TABLE T_BD_BOMVERSION ADD (FMATERIALGROUPID BIGINT DEFAULT 0 NOT NULL);
