Skip to content

Commit

Permalink
Fix mistakes
Browse files Browse the repository at this point in the history
* Remove unused key.
* Fix bad offset.
* Fix commented out code.
* Fix columns in indexes.
  • Loading branch information
markstory committed May 28, 2013
1 parent a16b861 commit e2f8696
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions lib/Cake/Console/Command/UpgradeShell.php
Expand Up @@ -312,7 +312,7 @@ public function fixtures() {
$this->out(__d('cake_console', 'Updating %s...', $file), 1, Shell::VERBOSE);
$content = $this->_processFixture(file_get_contents($file));
if (empty($this->params['dryRun'])) {
// file_put_contents($file, $content);
file_put_contents($file, $content);
}
}
}
Expand Down Expand Up @@ -362,7 +362,9 @@ protected function _processFixture($content) {
'columns' => [$field]
];
}
unset($properties['key']);
if (isset($properties['key'])) {
unset($properties['key']);
}
if ($field !== 'indexes') {
$out[$field] = $properties;
}
Expand All @@ -371,6 +373,10 @@ protected function _processFixture($content) {
// Process indexes. Unique keys work differently now.
if (isset($data['indexes'])) {
foreach ($data['indexes'] as $index => $indexProps) {
if (isset($indexProps['column'])) {
$indexProps['columns'] = $indexProp['column'];
unset($indexProp['column']);
}
// Move unique indexes over
if (!empty($indexProps['unique'])) {
unset($indexProps['unique']);
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/TestSuite/Fixture/TestFixture.php
Expand Up @@ -181,7 +181,7 @@ protected function _schemaFromImport() {
return;
}
$import = array_merge(
array('connection' => 'default', 'records' => false, 'table' => null),
array('connection' => 'default', 'table' => null),
$this->import
);

Expand Down

0 comments on commit e2f8696

Please sign in to comment.