mysql 更新数据
1 drop PROCEDURE IF EXISTS AddIsDoliday ; 2 CREATE PROCEDURE AddIsDoliday() 3 BEGIN 4 IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = 't_fee_static' AND column_name = 'IsDoliday') THEN 5 ALTER TABLE t_fee_static ADD IsDoliday int(4) DEFAULT 0 COMMENT '是否节假日(1:是;0否;)' AFTER ticketTimeType; 6 END IF; 7 IF NOT EXISTS (SELECT * FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = 't_fee_type' AND column_name = 'IsDoliday' ) THEN 8 ALTER TABLE t_fee_type ADD IsDoliday int(4) DEFAULT 0 COMMENT '是否节假日(1:是;0否;)' AFTER IsDelete; 9 END IF; 10 11 end ; 12 call AddIsDoliday(); 13 drop PROCEDURE IF EXISTS AddIsDoliday;