diff --git a/system/Database/Forge.php b/system/Database/Forge.php index c95ced88c4d6..44373452465e 100644 --- a/system/Database/Forge.php +++ b/system/Database/Forge.php @@ -324,6 +324,7 @@ public function addKey($key, bool $primary = false, bool $unique = false) } } else { $this->keys[] = $key; + $this->keys = array_unique($this->keys, SORT_REGULAR); if ($unique) { $this->uniqueKeys[] = count($this->keys) - 1;