From ace0782d7c7a0f7a2c4bc5b7977d4b8604069818 Mon Sep 17 00:00:00 2001 From: Alexander Nell Date: Tue, 19 May 2020 14:00:52 +0200 Subject: [PATCH] Fixed database migration error handling on local records --- plugins/MCTeam/LocalRecordsPlugin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/MCTeam/LocalRecordsPlugin.php b/plugins/MCTeam/LocalRecordsPlugin.php index ab23c79b..949b4a26 100644 --- a/plugins/MCTeam/LocalRecordsPlugin.php +++ b/plugins/MCTeam/LocalRecordsPlugin.php @@ -206,7 +206,8 @@ class LocalRecordsPlugin implements CallbackListener, CallQueueListener, Command $mysqli->query("ALTER TABLE `" . self::TABLE_RECORDS . "` ADD `checkpoints` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL"); if ($mysqli->error) { - if (!strstr($mysqli->error, 'Duplicate')) { + if ($mysqli->errno === 1062) { + // Duplicate trigger_error($mysqli->error, E_USER_ERROR); } }