DROP PROCEDURE IF EXISTS add_tb_column;
DELIMITER $$
CREATE PROCEDURE add_tb_column()
BEGIN
		DECLARE  CurrentDatabase VARCHAR(100);
SELECT DATABASE() INTO CurrentDatabase;

-- qw_sop 表添加 open_comment_status 字段
IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS  WHERE TABLE_SCHEMA=CurrentDatabase
            AND TABLE_NAME='qw_sop'
            AND COLUMN_NAME='open_comment_status' )
		THEN
alter table qw_sop add column open_comment_status int COMMENT '开启评论或者弹幕，1-开启评论；2-开启弹幕；3-都关闭';
END IF;

END;

CALL add_tb_column;
DROP PROCEDURE IF EXISTS add_tb_column;
