4

I want to drop a foreign key in a doctrine 2 migration. But there is no dropForeignKeyConstraint()

Does anybody know how to drop it?

4

2 回答 2

4
public function down(Schema $schema)
{
    $table = $schema->getTable('table_name');
    $table->removeForeignKey('foreign_key_name');
}
于 2014-01-15T19:58:12.713 回答
-2

这里是:

public function down()
{
    $this->dropForeignKey('table_name', 'email_foreign_key');
}

http://www.doctrine-project.org/projects/orm/1.2/docs/manual/migrations/en

于 2011-05-15T20:46:48.630 回答