#添加外键
alter table t_message_role_resource
add constraint f_role_id
foreign key (message_role_id)
references t_message_role(id)
#删除外键
ALTER TABLE 表名
DROP FOREIGN KEY 外键名;
#设置联合索引
alter table 表名 add unique index(字段名1,字段名2);
CREATE UNIQUE INDEX index_name ON table_name (column_list)
#删除索引
ALTER TABLE 表名 DROP INDEX 索引名(没有引号)