如何在原则2中移除外键 [英] How to drop a foreign key in doctrine 2 migrations
本文介绍了如何在原则2中移除外键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
但是没有dropForeignKeyConstraint()
有人知道如何删除它吗?
解决方案
public function down(Schema $ schema)
{
$ table = $ schema-> getTable('table_name');
$ table-> removeForeignKey('foreign_key_name');
}
I want to drop a foreign key in a doctrine 2 migration. But there is no dropForeignKeyConstraint()
Does anybody know how to drop it?
解决方案
public function down(Schema $schema)
{
$table = $schema->getTable('table_name');
$table->removeForeignKey('foreign_key_name');
}
这篇关于如何在原则2中移除外键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文