MySQL删除表字段(存在时删除)可重复执行

https://koda.iteye.com/blog/641646

    drop procedure if exists schema_change;  
    delimiter ';;';  
    create procedure schema_change() begin  
    if exists (select * from information_schema.columns where table_name = 'sales_order' and column_name = 'has_sent') then  
            alter table sales_order drop column has_sent;  
    end if;  
    alter table sales_order add column has_sent boolean;  
    end;;  
    delimiter ';';  
    call schema_change();  
    drop procedure if exists schema_change;  
上一篇:1. python 优化速度-更换编译器


下一篇:C# Attribute(特性)之---数据契约 [DataContract]