CREATe TABLE test (
`id` BIGINT(20) AUTO_INCREMENT,
`name` CHAR(255) unique not null,
primary key (`id`)
);
show create table test;
-- 因为unique字段会被默认创建为索引
alter table test drop index name;
alter table test change name name char(255) not null;
show create table test;