Fix checked property when adding indices to `DatabaseTable`
authorMatthias Schmidt <gravatronics@live.com>
Fri, 29 Jan 2021 14:55:26 +0000 (15:55 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 29 Jan 2021 14:55:26 +0000 (15:55 +0100)
wcfsetup/install/files/lib/system/database/table/DatabaseTable.class.php

index 21b96c55a3240a0c050a3cad22979ccf3f379dba..77aecdd6a1c7ed39e21c97b545d19a798172d519 100644 (file)
@@ -214,7 +214,7 @@ class DatabaseTable {
                                $index->generatedName(md5($this->getName() . '_' . $index->getColumns()[0]));
                        }
                        
-                       if (isset($this->foreignKeys[$index->getName()])) {
+                       if (isset($this->indices[$index->getName()])) {
                                throw new \InvalidArgumentException("Duplicate index with name '{$index->getName()}'.");
                        }