Cleaning up foreign key support. Added drop_foreign command.

Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
Taylor Otwell
2012-03-02 10:23:27 -06:00
parent 2f2437a0e3
commit 1d93cab0d0
5 changed files with 101 additions and 111 deletions

View File

@@ -207,6 +207,17 @@ class Table {
return $this->drop_key(__FUNCTION__, $name);
}
/**
* Drop a foreign key constraint from the table.
*
* @param string $name
* @return void
*/
public function drop_foreign($name)
{
return $this->drop_key(__FUNCTION__, $name);
}
/**
* Create a command to drop any type of index.
*
@@ -216,7 +227,7 @@ class Table {
*/
protected function drop_key($type, $name)
{
return $this->command($type, array('name' => $name));
return $this->command($type, compact('name'));
}
/**