1
0
mirror of synced 2025-03-16 21:21:50 +03:00

reapplied my changes to Export.php that were (accidently?) reverted by jonwage

This commit is contained in:
romanb 2007-10-20 14:57:47 +00:00
parent 2d1b5cc631
commit a14db264ee
2 changed files with 13 additions and 2 deletions

View File

@ -128,10 +128,21 @@ class Doctrine_Export extends Doctrine_Connection_Module
public function dropConstraint($table, $name, $primary = false)
{
$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);
}
/**
* 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
* drop existing sequence

View File

@ -56,7 +56,7 @@ class Doctrine_Export_TestCase extends Doctrine_UnitTestCase
{
$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()
{