Skip to content

Commit

Permalink
Remove non primary key indexes.
Browse files Browse the repository at this point in the history
They are rarely used, and rarely work well.
  • Loading branch information
markstory committed May 28, 2013
1 parent e3357d2 commit dccf9ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Cake/Console/Command/UpgradeShell.php
Original file line number Diff line number Diff line change
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 @@ -355,14 +355,14 @@ protected function _processFixture($content) {
$constraints = [];
$out = [];
foreach ($data as $field => $properties) {
// Move 'key' into a constraint
// Move primary key into a constraint
if (isset($properties['key']) && $properties['key'] === 'primary') {
$constraints['primary'] = [
'type' => 'primary',
'columns' => [$field]
];
unset($properties['key']);
}
unset($properties['key']);
if ($field !== 'indexes') {
$out[$field] = $properties;
}
Expand Down

0 comments on commit dccf9ac

Please sign in to comment.