Skip to content
Permalink
Browse files

Pepending table name to index generation to avoid name clashes

Finally, all tests using a Sqlite database pass
  • Loading branch information...
lorenzo committed Dec 3, 2010
1 parent e167271 commit 66d0986cd4380120c89ff3a45f78d7cda9469ce6
Showing with 4 additions and 3 deletions.
  1. +2 −1 cake/libs/model/datasources/dbo/dbo_sqlite.php
  2. +2 −2 cake/tests/cases/libs/all_database.test.php
@@ -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;
@@ -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');

0 comments on commit 66d0986

Please sign in to comment.
You can’t perform that action at this time.