Pepending table name to index generation to avoid name clashes

Finally, all tests using a Sqlite database pass
This commit is contained in:
José Lorenzo Rodríguez 2010-12-03 15:25:04 -04:30
parent e167271568
commit 66d0986cd4
2 changed files with 4 additions and 3 deletions

View file

@ -443,7 +443,8 @@ class DboSqlite extends DboSource {
} else {
$value['column'] = $this->name($value['column']);
}
$out .= "INDEX {$name} ON {$table}({$value['column']});";
$t = trim($table, '"');
$out .= "INDEX {$t}_{$name} ON {$table}({$value['column']});";
$join[] = $out;
}
return $join;

View file

@ -37,14 +37,14 @@ class AllDatabaseTest extends PHPUnit_Framework_TestSuite {
$suite = new PHPUnit_Framework_TestSuite('Datasources, Schema and DbAcl tests');
$path = CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS;
$tasks = array(
'db_acl',
'cake_schema',
'connection_manager',
'datasources' . DS . 'dbo_source',
'datasources' . DS . 'dbo' . DS . 'dbo_mysql',
'datasources' . DS . 'dbo' . DS . 'dbo_postgres'
'datasources' . DS . 'dbo' . DS . 'dbo_postgres',
'datasources' . DS . 'dbo' . DS . 'dbo_sqlite'
);
foreach ($tasks as $task) {
$suite->addTestFile($path . $task . '.test.php');