Fix mising connection parameter to schema objects.

When calling create/update the created schema object should be passed
the current connection.

Fixes #2668
This commit is contained in:
mark_story 2014-01-16 17:19:22 -05:00
parent f25e84f4fb
commit 46eda802e5

View file

@ -282,7 +282,11 @@ class SchemaShell extends AppShell {
$this->out(__d('cake_console', 'Performing a dry run.'));
}
$options = array('name' => $name, 'plugin' => $plugin);
$options = array(
'name' => $name,
'plugin' => $plugin,
'connection' => $this->params['connection'],
);
if (!empty($this->params['snapshot'])) {
$fileName = rtrim($this->Schema->file, '.php');
$options['file'] = $fileName . '_' . $this->params['snapshot'] . '.php';