Fixed database migration error handling on local records

This commit is contained in:
Alexander Nell 2020-05-19 14:00:52 +02:00
parent fea298cf58
commit ace0782d7c

View File

@ -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"); $mysqli->query("ALTER TABLE `" . self::TABLE_RECORDS . "` ADD `checkpoints` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL");
if ($mysqli->error) { if ($mysqli->error) {
if (!strstr($mysqli->error, 'Duplicate')) { if ($mysqli->errno === 1062) {
// Duplicate
trigger_error($mysqli->error, E_USER_ERROR); trigger_error($mysqli->error, E_USER_ERROR);
} }
} }