reapplied my changes to Export.php that were (accidently?) reverted by jonwage
This commit is contained in:
parent
2d1b5cc631
commit
a14db264ee
@ -128,10 +128,21 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
|||||||
public function dropConstraint($table, $name, $primary = false)
|
public function dropConstraint($table, $name, $primary = false)
|
||||||
{
|
{
|
||||||
$table = $this->conn->quoteIdentifier($table);
|
$table = $this->conn->quoteIdentifier($table);
|
||||||
$name = $this->conn->quoteIdentifier($this->conn->formatter->getIndexName($name));
|
$name = $this->conn->quoteIdentifier($name);
|
||||||
|
|
||||||
return $this->conn->exec('ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $name);
|
return $this->conn->exec('ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $name);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* drop existing foreign key
|
||||||
|
*
|
||||||
|
* @param string $table name of table that should be used in method
|
||||||
|
* @param string $name name of the foreign key to be dropped
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function dropForeignKey($table, $name)
|
||||||
|
{
|
||||||
|
return $this->dropConstraint($table, $name);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* dropSequenceSql
|
* dropSequenceSql
|
||||||
* drop existing sequence
|
* drop existing sequence
|
||||||
|
@ -56,7 +56,7 @@ class Doctrine_Export_TestCase extends Doctrine_UnitTestCase
|
|||||||
{
|
{
|
||||||
$this->export->dropConstraint('sometable', 'relevancy');
|
$this->export->dropConstraint('sometable', 'relevancy');
|
||||||
|
|
||||||
$this->assertEqual($this->adapter->pop(), 'ALTER TABLE sometable DROP CONSTRAINT relevancy_idx');
|
$this->assertEqual($this->adapter->pop(), 'ALTER TABLE sometable DROP CONSTRAINT relevancy');
|
||||||
}
|
}
|
||||||
public function testCreateIndexExecutesSql()
|
public function testCreateIndexExecutesSql()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user