Merge #15659 - Fix #14732 Can't rename primary key with auto increment

Pull-request: #15659
Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
William Desportes 2019-12-16 22:10:26 +01:00
commit a993e36aca
No known key found for this signature in database
GPG Key ID: 90A0EF1B8251A889

View File

@ -641,7 +641,7 @@ class Table
$query .= ' AFTER ' . Util::backquote($move_to);
}
if (! $virtuality && ! empty($extra)) {
if (is_array($columns_with_index) && ! in_array($name, $columns_with_index)) {
if (empty($columns_with_index) && ! in_array($name, $columns_with_index)) {
$query .= ', add PRIMARY KEY (' . Util::backquote($name) . ')';
}
}