mysql ddl online
新增字段:
alter table biz_order ADD vin_id bigint(20) unsigned NULL COMMENT 'vin卡',ALGORITHM = INPLACE,LOCK = NONE;
多个字段
ALTER TABLE rec_cg_status ADD (fee5_quantity int(11) DEFAULT 0 NULL COMMENT '5电量',
fee5_quantity_fee int(11) DEFAULT 0 NULL COMMENT '尖电费',
fee5_server_fee int(11) DEFAULT 0 NULL COMMENT '尖服务费',
fee6_quantity int(11) DEFAULT 0 NULL COMMENT '6电量',
fee6_quantity_fee int(11) DEFAULT 0 NULL COMMENT '6电费',
fee6_server_fee int(11) DEFAULT 0 NULL COMMENT '6服务费',
fee7_quantity int(11) DEFAULT 0 NULL COMMENT '7电量',
fee7_quantity_fee int(11) DEFAULT 0 NULL COMMENT '7电费',
fee7_server_fee int(11) DEFAULT 0 NULL COMMENT '7服务费',
fee8_quantity int(11) DEFAULT 0 NULL COMMENT '8电量',
fee8_quantity_fee int(11) DEFAULT 0 NULL COMMENT '8电费',
fee8_server_fee int(11) DEFAULT 0 NULL COMMENT '8服务费'),ALGORITHM = INPLACE,LOCK = NONE;
更新字段
alter table rec_cg_order modify cg_no varchar(27) NOT NULL,ALGORITHM = INPLACE,LOCK = NONE;
新增索引
ALTER TABLE wxcp_client ADD INDEX idx_mp_client_id (mp_client_id),ALGORITHM = INPLACE,LOCK = NONE;
ALTER TABLE qw_session ADD UNIQUE INDEX account_conversation_id_IDX (account_id,conversation_id),ALGORITHM = INPLACE,LOCK = NONE;
ALTER TABLE qw_session ADD UNIQUE INDEX conversation_account_id_IDX (conversation_id,account_id),ALGORITHM = INPLACE,LOCK = NONE;
ALTER TABLE mp_client ADD INDEX qw_id_IDX (qw_id),ALGORITHM = INPLACE,LOCK = NONE;
https://blog.csdn.net/weixin_41519463/article/details/107689821