Permalink
Browse files

[2.0] Fixed hardcoded database name.

  • Loading branch information...
1 parent 0b09e50 commit acec85a412c369fd3e4ef3470ecc54cd0ebd70c3 romanb committed May 30, 2009
@@ -190,7 +190,7 @@ public function getListTableForeignKeysSql($table, $database = null)
$sql = "SELECT column_name, REFERENCED_TABLE_NAME, REFERENCED_COLUMN_NAME FROM information_schema.key_column_usage WHERE table_name = '" . $table . "'";
if ( ! is_null($database)) {
- $sql .= " AND table_schema = 'doctrine_tests'";
+ $sql .= " AND table_schema = '$database'";
}
$sql .= " AND REFERENCED_COLUMN_NAME is not NULL";
@@ -221,7 +221,6 @@ public function listTableForeignKeys($table, $database = null)
$database = $this->_conn->getDatabase();
}
$sql = $this->_platform->getListTableForeignKeysSql($table, $database);
-
$tableForeignKeys = $this->_conn->fetchAll($sql);
return $this->_getPortableTableForeignKeysList($tableForeignKeys);
@@ -16,7 +16,7 @@
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
- * <http://www.phpdoctrine.org>.
+ * <http://www.doctrine-project.org>.
*/
namespace Doctrine\DBAL\Schema;
@@ -120,15 +120,15 @@ public function testListTableForeignKeys()
$data['options'] = array('type' => 'innodb');
$this->createTestTable('list_table_foreign_keys_test1', $data);
$this->createTestTable('list_table_foreign_keys_test2', $data);
-
+
$definition = array(
'name' => 'testing',
'local' => 'foreign_key_test',
'foreign' => 'id',
'foreignTable' => 'list_table_foreign_keys_test2'
);
$this->_sm->createForeignKey('list_table_foreign_keys_test1', $definition);
-
+
$tableForeignKeys = $this->_sm->listTableForeignKeys('list_table_foreign_keys_test1');
$this->assertEquals(1, count($tableForeignKeys));
$this->assertEquals('list_table_foreign_keys_test2', $tableForeignKeys[0]['table']);

0 comments on commit acec85a

Please sign in to comment.