mysql 修改字段语句 + 添加索引语句
修改表tax_version添加up_content属性为text类型非空,注释为“更新内容”,字段添加再“name”属性后面
ALTER TABLE `tax_version` ADD `up_content` TEXT NOT NULL COMMENT '更新内容' AFTER `name`;
来自:https://www.cnblogs.com/aj407blogs/p/9808455.html
1.PRIMARY KEY(主键索引)
mysql>ALTER TABLE `table_name` ADD PRIMARY KEY ( `column` )
2.UNIQUE(唯一索引)
mysql>ALTER TABLE `table_name` ADD UNIQUE (`column` )
3.INDEX(普通索引)
mysql>ALTER TABLE `table_name` ADD INDEX index_name ( `column` )
4.FULLTEXT(全文索引)
mysql>ALTER TABLE `table_name` ADD FULLTEXT ( `column` )
5.多列索引
mysql>ALTER TABLE `table_name` ADD INDEX index_name ( `column1`, `column2`, `column3` )
来自:https://www.cnblogs.com/hgxbo/p/10489874.html