English 中文(简体)
How to drop a foreign key in doctrine 2 migrations
原标题:

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 );
}

Here it is:

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

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





相关问题
Copy data from Access to SQL

I am in the process of migrating an existing Access database to a SQL database with a web front-end. I have successfully copied the database to SQL using the SQL Server Migration tool and am working ...

MongoMapper and migrations

I m building a Rails application using MongoDB as the back-end and MongoMapper as the ORM tool. Suppose in version 1, I define the following model: class SomeModel include MongoMapper::Document ...

Switching to WPF. Is it time?

I m considering switching from MFC to WPF. My first concern is that there are too many users who don t have .NET with WPF installed yet. Can anybody point to a source containing the WPF penetration ...

rake db:migrate running all migrations correctly

I m fairly new to Ruby on Rails here. I have 2 migrate files that were provided. The first one, prefixed with 001, creates a table and some columns for that table. The next migrate file, prefixed ...

Migrate Java Applet to what/where?

I am reviewing currently a medium size code base (around 30K LOC) which uses a huge Applet and interfaces with other systems. It s a tool to create custom labels, so we need drag-n-drop and other ...

热门标签