-- 修改通知邮件title字段
DROP PROCEDURE IF EXISTS `MODIFY_TITLE_COLUMN_IN_NOTICE_MAIL`;
DELIMITER //
CREATE PROCEDURE `MODIFY_TITLE_COLUMN_IN_NOTICE_MAIL`()
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION BEGIN END;
IF EXISTS (SELECT * FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = 't_notice_mail' AND column_name ='title')
THEN
UPDATE t_notice_mail SET title=NULL;
ALTER TABLE `t_notice_mail` CHANGE title title varchar(64) COMMENT 'mail title';
END IF;
END //
DELIMITER ;
CALL `MODIFY_TITLE_COLUMN_IN_NOTICE_MAIL`();
DROP PROCEDURE `MODIFY_TITLE_COLUMN_IN_NOTICE_MAIL`;
sjhuangx 发布了98 篇原创文章 · 获赞 83 · 访问量 44万+ 私信 关注