Skip to content
Permalink
Browse files

MySQL DbdSource alter field support 'after'

The ALTER FIELD for MySQL should support 'after' just like the ADD FIELD
  • Loading branch information...
zeroasterisk committed May 29, 2014
1 parent a135378 commit c273ed8d2ccbbdf461ec3504b882642705a4d0f0
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/Cake/Model/Datasource/Database/Mysql.php
@@ -560,7 +560,11 @@ public function alterSchema($compare, $table = null) {
if (!isset($col['name'])) {
$col['name'] = $field;
}
$colList[] = 'CHANGE ' . $this->name($field) . ' ' . $this->buildColumn($col);
$alter = 'CHANGE ' . $this->name($field) . ' ' . $this->buildColumn($col);
if (isset($col['after'])) {
$alter .= ' AFTER ' . $this->name($col['after']);
}
$colList[] = $alter;
}
break;
}

0 comments on commit c273ed8

Please sign in to comment.
You can’t perform that action at this time.