From 38d2e2eeeada89520d1428938476fdd914dcef8e Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 8 Sep 2019 15:05:02 +0200 Subject: [PATCH] Check if foreign key has an action --- .../files/lib/system/database/table/DatabaseTable.class.php | 4 ++++ 1 file changed, 4 insertions(+) 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; } -- 2.20.1