Home  >  Article  >  Database  >  mysql的几个alter tabl命令(备忘)_MySQL

mysql的几个alter tabl命令(备忘)_MySQL

WBOY
WBOYOriginal
2016-05-31 08:47:101066browse

删除外键:

alter table `itrip_shop` drop FOREIGN KEY `FK_ayixnihiit0pouq70l8ig0ax9`;


删除唯一键:

alter table `itrip_shop` drop index `UK_ayixnihiit0pouq70l8ig0ax9`;


添加外键约束(复杂选项版):

alter table `itrip_shop` ADD CONSTRAINT `FK_ayixnihiit0pouq70l8ig0ax9` FOREIGN KEY `FK_ayixnihiit0pouq70l8ig0ax9` (`shop_admin`) REFERENCES `itrip_user` (`user_id`);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn