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

-- company_user 表添加 is_need_register_member 字段
IF NOT EXISTS (SELECT 1 FROM information_schema.COLUMNS  WHERE TABLE_SCHEMA=CurrentDatabase
            AND TABLE_NAME='company_user'
            AND COLUMN_NAME='is_need_register_member' )
		THEN
alter table company_user add column is_need_register_member tinyint(1)  DEFAULT 0 COMMENT '是否需要单独注册会员，1-是，0-否（用于个微销售分享看课）';
END IF;

END;

CALL add_tb_column;

DROP PROCEDURE IF EXISTS add_tb_column;
