Fix missing prefix when reading table schema.

When using prefixes, table metadata would be lost.
Fixes #1522

Signed-off-by: mark_story <mark@mark-story.com>

Conflicts:

	lib/Cake/Model/CakeSchema.php
This commit is contained in:
fiblan 2011-10-24 19:34:49 +03:00 committed by mark_story
parent 85ae6846c4
commit 9c4a9bbd06

View file

@ -306,18 +306,21 @@ class CakeSchema extends Object {
$systemTables = array(
'aros', 'acos', 'aros_acos', Configure::read('Session.table'), 'i18n'
);
$fulltable = $db->fullTableName($Object, false);
if (in_array($table, $systemTables)) {
$tables[$Object->table] = $this->_columns($Object);
$tables[$Object->table]['indexes'] = $db->index($Object);
$tables[$Object->table]['tableParameters'] = $db->readTableParameters($table);
$tables[$Object->table]['tableParameters'] = $db->readTableParameters($fulltable);
} elseif ($models === false) {
$tables[$table] = $this->_columns($Object);
$tables[$table]['indexes'] = $db->index($Object);
$tables[$table]['tableParameters'] = $db->readTableParameters($table);
$tables[$table]['tableParameters'] = $db->readTableParameters($fulltable);
} else {
$tables['missing'][$table] = $this->_columns($Object);
$tables['missing'][$table]['indexes'] = $db->index($Object);
$tables['missing'][$table]['tableParameters'] = $db->readTableParameters($table);
$tables['missing'][$table]['tableParameters'] = $db->readTableParameters($fulltable);
}
}
}