USE `lego`;

DROP PROCEDURE IF EXISTS del_https_policy;
DELIMITER //
CREATE PROCEDURE del_https_policy() BEGIN
    IF EXISTS(SELECT * FROM information_schema.columns
           WHERE table_name = 't_vsm_zone_httpsflood' AND column_name ='https_high_freq_detect_enable')
    THEN
        ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_high_freq_detect_enable;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_high_freq_detect_threshold;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_high_freq_detect_interval;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_fix_res_enable;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_fix_res_ratio_number;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_fix_res_threshold;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_fix_res_interval;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_large_res_detect_enable;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_large_res_size;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_large_res_detect_ratio;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_large_res_detect_threshold;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_large_res_detect_interval;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_dest_ip_conn_num_enable;
		ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_dest_ip_conn_num;
        ALTER TABLE t_vsm_zone_httpsflood DROP COLUMN https_src_advance_enable;
    END IF;
END;
//
DELIMITER ;
CALL del_https_policy();

DROP PROCEDURE IF EXISTS del_https_policy;