GitHub 博客园 Nanakon

mysql操作

删除外键

show create table tag;

alter table tag drop foreign key tag_ibfk_1;

alter table tag drop column category_id;

 

alter table tag drop foreign key tag_ibfk_3;
alter table filter rename to category;
alter table category change filter_id category_id INT UNSIGNED NOT NULL AUTO_INCREMENT;
alter table tag change filter_id category_id INT UNSIGNED NULL;
alter table `tag` add CONSTRAINT `tag_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) ;

 

posted on 2016-08-30 13:19  jzm17173  阅读(104)  评论(0编辑  收藏  举报

导航

轻音