From 13e91a0e932c50acbec6f268cf8ad06b04a36271 Mon Sep 17 00:00:00 2001 From: Nikhil Nagdev Date: Tue, 17 Dec 2019 01:16:33 +0530 Subject: [PATCH] Fixed issue of renaming the primary key Signed-off-by: Nikhil Nagdev --- libraries/classes/Table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/classes/Table.php b/libraries/classes/Table.php index 1f4e34d3d6..159cb51f5e 100644 --- a/libraries/classes/Table.php +++ b/libraries/classes/Table.php @@ -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) . ')'; } }