From 95df9b9018f4e221fd96becb0bd5abc30dcf9eff Mon Sep 17 00:00:00 2001 From: Ferywir <65760459+Ferywir@users.noreply.github.com> Date: Thu, 4 Jun 2026 18:51:37 +0200 Subject: [PATCH] Fix HTTP 500 when queuing a 2nd Smithy/Armoury upgrade of the same unit (#173) --- var/db/struct.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/var/db/struct.sql b/var/db/struct.sql index e8ce958e..a6155acc 100644 --- a/var/db/struct.sql +++ b/var/db/struct.sql @@ -1292,8 +1292,11 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%research` ( `timestamp` int(11) NULL, PRIMARY KEY (`id`), KEY `vref` (`vref`), - KEY `timestamp` (`timestamp`), - UNIQUE KEY `vref_tech` (`vref`,`tech`) + KEY `timestamp` (`timestamp`) + -- NOTE: no UNIQUE(vref,tech) here on purpose. The Smithy/Armoury queue stores + -- each queued upgrade of the SAME unit as its own row (same tech, different + -- timestamp). A UNIQUE(vref,tech) made the 2nd queued upgrade INSERT fail, + -- which under PHP 8 mysqli (exceptions on) became an uncaught HTTP 500. ) ENGINE=InnoDB DEFAULT CHARSET=utf8; --