删除UK
alter table preliminary_collection_repay_record drop index index_prc_id
说明:alter table 表名 drop index 索引字段名称;
添加字段
ALTER TABLE people ADD COLUMN name VARCHAR(100) DEFAULT NULL COMMENT '姓名' AFTER age;
说明:alter table (表名) add (字段) varchar(500) not null default "备注..."
修改表 people 增加字段 name 长度100 默认为null 备注:姓名 在age字段后面;
修改关联查询时出现的SQL排序类型不一致报错:
java.sql.SQLException: Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_0900_ai_ci,IMPLICIT) for operation '='
解决方法:ALTER TABLE (表名) MODIFY COLUMN (被修改字段) VARCHAR(64) COLLATE utf8_unicode_ci COMMENT '订单编号';