Skip to content

Commit

Permalink
Pepending table name to index generation to avoid name clashes
Browse files Browse the repository at this point in the history
Finally, all tests using a Sqlite database pass
  • Loading branch information
lorenzo committed Dec 3, 2010
1 parent e167271 commit 66d0986
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cake/libs/model/datasources/dbo/dbo_sqlite.php
Expand Up @@ -443,7 +443,8 @@ function buildIndex($indexes, $table = null) {
} 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;
Expand Down
4 changes: 2 additions & 2 deletions cake/tests/cases/libs/all_database.test.php
Expand Up @@ -37,14 +37,14 @@ public static function suite() {
$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');
Expand Down

0 comments on commit 66d0986

Please sign in to comment.