From 431f2c2a882b142ca4c0a718618d7123b6e3a799 Mon Sep 17 00:00:00 2001 From: gwoo Date: Thu, 8 Nov 2007 19:06:06 +0000 Subject: [PATCH] updating schema generation git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5969 3807eeeb-6ff5-0310-8944-8be069107fe0 --- cake/console/libs/schema.php | 4 ++-- cake/libs/model/schema.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 36a10b0ec..a9bb65d34 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -97,8 +97,6 @@ class SchemaShell extends Shell { $options = array('models' => false); } - $content = $this->Schema->read($options); - $snapshot = false; if (isset($this->args[0]) && $this->args[0] === 'snapshot') { $snapshot = true; @@ -115,7 +113,9 @@ class SchemaShell extends Shell { } } + $content = $this->Schema->read($options); $content['file'] = 'schema.php'; + if($snapshot === true) { $Folder =& new Folder($this->Schema->path); $result = $Folder->read(); diff --git a/cake/libs/model/schema.php b/cake/libs/model/schema.php index 8a9a0ea0d..3fd28ae3f 100644 --- a/cake/libs/model/schema.php +++ b/cake/libs/model/schema.php @@ -173,7 +173,8 @@ class CakeSchema extends Object { if (isset($db->config['prefix'])) { $prefix = $db->config['prefix']; } - if (empty($models) && $models !== false) { + + if (!is_array($models) && $models !== false) { $models = Configure::listObjects('model'); }