Permalink
Browse files

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>
  • Loading branch information...
1 parent 2bdb4fe commit 8ff669dd1572fb8a6de8549068ca2795d4c6345d @fiblan fiblan committed with markstory Oct 24, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 cake/libs/model/cake_schema.php
@@ -309,19 +309,21 @@ function read($options = array()) {
$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);
}
}
}

0 comments on commit 8ff669d

Please sign in to comment.