USE `lego`;

DROP PROCEDURE IF EXISTS drop_udp_first_packet_check;
DELIMITER //
CREATE PROCEDURE drop_udp_first_packet_check() BEGIN
    IF EXISTS(SELECT * FROM information_schema.columns
           WHERE table_name = 't_vsm_zone_udpflood' AND column_name ='udp_first_packet_check_enable')
    THEN
        ALTER TABLE t_vsm_zone_udpflood drop COLUMN udp_first_packet_check_enable;
    END IF;
    IF EXISTS(SELECT * FROM information_schema.columns
           WHERE table_name = 't_vsm_zone_udpflood' AND column_name ='udp_upper_limit')
    THEN
        ALTER TABLE t_vsm_zone_udpflood drop COLUMN udp_upper_limit;
    END IF;
END;
//
DELIMITER ;
CALL drop_udp_first_packet_check();

DROP PROCEDURE IF EXISTS drop_udp_first_packet_check;