Revert "Fix DatabaseTableChangeProcessor::getColumnByName() for WSC < 5.4"
authorMatthias Schmidt <gravatronics@live.com>
Fri, 18 Dec 2020 18:36:07 +0000 (19:36 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Fri, 18 Dec 2020 18:36:07 +0000 (19:36 +0100)
This reverts commit 7c8a1b332fd09ddb046dccfba9e92c463a18a414.

wcfsetup/install/files/lib/system/database/table/DatabaseTableChangeProcessor.class.php

index e05c67c607397b5b2b7dce09f183e0af76e24a09..562ff27db7d18fab6f3a9071bc06842a4e2f2726 100644 (file)
@@ -1217,7 +1217,10 @@ class DatabaseTableChangeProcessor {
         */
        protected function getColumnByName($columnName, DatabaseTable $updateTable, DatabaseTable $existingTable = null) {
                foreach ($updateTable->getColumns() as $column) {
-                       if ($column->getName() === $columnName) {
+                       if (
+                               ($column->getNewName() === $columnName)
+                               || ($column->getName() === $columnName && !$column->getNewName())
+                       ) {
                                return $column;
                        }
                }