From: Matthias Schmidt Date: Sun, 8 Sep 2019 13:05:02 +0000 (+0200) Subject: Check if foreign key has an action X-Git-Tag: 5.2.0_Beta_2~29^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=38d2e2eeeada89520d1428938476fdd914dcef8e;p=GitHub%2FWoltLab%2FWCF.git Check if foreign key has an action --- diff --git a/wcfsetup/install/files/lib/system/database/table/DatabaseTable.class.php b/wcfsetup/install/files/lib/system/database/table/DatabaseTable.class.php index bc6c9c3f17..9ef900887d 100644 --- a/wcfsetup/install/files/lib/system/database/table/DatabaseTable.class.php +++ b/wcfsetup/install/files/lib/system/database/table/DatabaseTable.class.php @@ -102,6 +102,10 @@ class DatabaseTable { throw new \InvalidArgumentException("Duplicate foreign key with name '{$foreignKey->getName()}'."); } + if ($foreignKey->getOnDelete() === null && $foreignKey->getOnUpdate() === null) { + throw new \InvalidArgumentException("Missing action for foreign key '{$foreignKey->getName()}'."); + } + $this->foreignKeys[$foreignKey->getName()] = $foreignKey; }