Skip to content

Commit e2f8696

Browse files
committed
Fix mistakes
* Remove unused key. * Fix bad offset. * Fix commented out code. * Fix columns in indexes.
1 parent a16b861 commit e2f8696

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/Cake/Console/Command/UpgradeShell.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ public function fixtures() {
312312
$this->out(__d('cake_console', 'Updating %s...', $file), 1, Shell::VERBOSE);
313313
$content = $this->_processFixture(file_get_contents($file));
314314
if (empty($this->params['dryRun'])) {
315-
// file_put_contents($file, $content);
315+
file_put_contents($file, $content);
316316
}
317317
}
318318
}
@@ -362,7 +362,9 @@ protected function _processFixture($content) {
362362
'columns' => [$field]
363363
];
364364
}
365-
unset($properties['key']);
365+
if (isset($properties['key'])) {
366+
unset($properties['key']);
367+
}
366368
if ($field !== 'indexes') {
367369
$out[$field] = $properties;
368370
}
@@ -371,6 +373,10 @@ protected function _processFixture($content) {
371373
// Process indexes. Unique keys work differently now.
372374
if (isset($data['indexes'])) {
373375
foreach ($data['indexes'] as $index => $indexProps) {
376+
if (isset($indexProps['column'])) {
377+
$indexProps['columns'] = $indexProp['column'];
378+
unset($indexProp['column']);
379+
}
374380
// Move unique indexes over
375381
if (!empty($indexProps['unique'])) {
376382
unset($indexProps['unique']);

lib/Cake/TestSuite/Fixture/TestFixture.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ protected function _schemaFromImport() {
181181
return;
182182
}
183183
$import = array_merge(
184-
array('connection' => 'default', 'records' => false, 'table' => null),
184+
array('connection' => 'default', 'table' => null),
185185
$this->import
186186
);
187187

0 commit comments

Comments
 (0)