INSERT INTO `InApp_WebSort` (`sort_id`,`sort_name`,`parentid`,`ifdisplay`,`sort_href`,`sort_icon_href`,`cate`,`SortNum`,`cate_name`,`encate_name`,`grade`,`has_child`)VALUES ('', 'vipset', '', '', null, 'admin/butler/vipset', '', '', 'vip优惠设定', 'vipset', '', '')
ON DUPLICATE KEY UPDATE sort_name = "vipset";
重点在
ON DUPLICATE KEY UPDATE sort_name = "vipset"
DELIMITER $$ DROP PROCEDURE IF EXISTS `ALTER_Field`$$ CREATE PROCEDURE `ALTER_Field`()
BEGIN IF EXISTS (SELECT * FROM information_schema.columns WHERE table_name = 'InApp_AdminMember' AND column_name = 'quota') = FALSE THEN
ALTER TABLE `InApp_AdminMember` ADD `quota` int(10) NOT NULL DEFAULT '' COMMENT '限额';
END IF; IF EXISTS (SELECT * FROM information_schema.columns WHERE table_name = 'InApp_AdminMember' AND column_name = 'point') = FALSE THEN
ALTER TABLE `InApp_AdminMember` ADD `point` int(10) NOT NULL DEFAULT '' COMMENT '已充金额';
END IF; IF EXISTS (SELECT * FROM information_schema.columns WHERE table_name = 'InApp_WalletPoint' AND column_name = 'giving_money') = FALSE THEN
ALTER TABLE `InApp_WalletPoint` ADD `giving_money` int(10) NOT NULL DEFAULT '' COMMENT '赠幣數';
END IF; IF EXISTS (SELECT * FROM information_schema.columns WHERE table_name = 'InApp_WalletPoint' AND column_name = 'consume_money') = FALSE THEN
ALTER TABLE `InApp_WalletPoint` ADD `consume_money` int(10) NOT NULL DEFAULT '' COMMENT '赠币消耗';
END IF; END$$ DELIMITER ; CALL ALTER_Field();
DROP PROCEDURE IF EXISTS `ALTER_Field`;
DELIMITER $$ DROP PROCEDURE IF EXISTS `ALTER_Field`$$ CREATE PROCEDURE `ALTER_Field`()
BEGIN IF EXISTS (SELECT * FROM information_schema.columns WHERE table_name = 'Dog_Photo' AND column_name = 'gif') = FALSE THEN
ALTER TABLE `Dog_Photo` add gif varchar() NOT NULL;
END IF; END$$ DELIMITER ; CALL ALTER_Field();
DROP PROCEDURE IF EXISTS `ALTER_Field`;