Skip to content

Commit 66d0986

Browse files
committed
Pepending table name to index generation to avoid name clashes
Finally, all tests using a Sqlite database pass
1 parent e167271 commit 66d0986

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

cake/libs/model/datasources/dbo/dbo_sqlite.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,8 @@ function buildIndex($indexes, $table = null) {
443443
} else {
444444
$value['column'] = $this->name($value['column']);
445445
}
446-
$out .= "INDEX {$name} ON {$table}({$value['column']});";
446+
$t = trim($table, '"');
447+
$out .= "INDEX {$t}_{$name} ON {$table}({$value['column']});";
447448
$join[] = $out;
448449
}
449450
return $join;

cake/tests/cases/libs/all_database.test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ public static function suite() {
3737
$suite = new PHPUnit_Framework_TestSuite('Datasources, Schema and DbAcl tests');
3838

3939
$path = CORE_TEST_CASES . DS . 'libs' . DS . 'model' . DS;
40-
4140
$tasks = array(
4241
'db_acl',
4342
'cake_schema',
4443
'connection_manager',
4544
'datasources' . DS . 'dbo_source',
4645
'datasources' . DS . 'dbo' . DS . 'dbo_mysql',
47-
'datasources' . DS . 'dbo' . DS . 'dbo_postgres'
46+
'datasources' . DS . 'dbo' . DS . 'dbo_postgres',
47+
'datasources' . DS . 'dbo' . DS . 'dbo_sqlite'
4848
);
4949
foreach ($tasks as $task) {
5050
$suite->addTestFile($path . $task . '.test.php');

0 commit comments

Comments
 (0)