mysql数据库新增和修改字段

 

 

8.0版本之上

-- 修改旧字段名为新字段名
ALTER TABLE bd_material_circuit_breaker 
    RENAME COLUMN release_type TO release_type_zh;

ALTER TABLE bd_material_circuit_breaker 
    RENAME COLUMN control_type TO control_type_zh;

ALTER TABLE bd_material_circuit_breaker 
    RENAME COLUMN installation_method TO installation_method_zh;

-- 新增英文字段
ALTER TABLE bd_material_circuit_breaker 
    ADD COLUMN release_type_en VARCHAR(255) COMMENT '脱扣器类型en';

ALTER TABLE bd_material_circuit_breaker 
    ADD COLUMN control_type_en VARCHAR(255) COMMENT '控制类型en';

ALTER TABLE bd_material_circuit_breaker 
    ADD COLUMN installation_method_en VARCHAR(255) COMMENT '安装方式en';

 

 

 

 

5.7版本

ALTER TABLE bd_material_circuit_breaker 
    CHANGE COLUMN release_type release_type_zh VARCHAR(255) COMMENT '脱扣器类型zh';



ALTER TABLE bd_material_circuit_breaker 
    CHANGE COLUMN control_type control_type_zh VARCHAR(255) COMMENT '控制类型zh';
        
    

ALTER TABLE bd_material_circuit_breaker 
    CHANGE COLUMN installation_method installation_method_zh VARCHAR(255) COMMENT '安装方式zh';
    
    
    



ALTER TABLE bd_material_circuit_breaker 
    ADD COLUMN release_type_en VARCHAR(255) COMMENT '脱扣器类型en';
    
    
ALTER TABLE bd_material_circuit_breaker 
    ADD COLUMN control_type_en VARCHAR(255) COMMENT '控制类型en';
    
ALTER TABLE bd_material_circuit_breaker 
    ADD COLUMN installation_method_en VARCHAR(255) COMMENT '安装方式en';

 

posted @ 2024-11-01 10:25  ProZkb  阅读(6)  评论(0编辑  收藏  举报