v5.4.4
Fixed
- The resource refused to start on servers that already had a
garagecolumn, withData truncated for column 'garage' at row 2in the console. The boot migration adds the columns msk_garage needs and then tightensgaragetovarchar(60) NOT NULL. On a fresh database the column is created correctly in the first step and the second one has nothing left to do. If the column already existed, from msk_garage v3 or from another garage script, the first step does nothing at all, becauseADD COLUMN IF NOT EXISTSskips a column that is already there without touching its definition. The column keeps the shape it had, which usually means it allowsNULLand is sometimes wider than 60 characters. The second step then has to map those existing rows onto the stricter definition, and aNULLcannot becomeNOT NULL. - Why it only happened on some servers. Whether that aborts the start or passes
silently comes down to your
sql_mode. WithSTRICT_TRANS_TABLES, the MariaDB default since 10.2.4, it is an error and the statement is rolled back. Without it the value is quietly turned into an empty string and you only get a warning in the console. An older database on a strict server is the combination that broke, and a fresh install never showed it at all. - What changed. msk_garage now cleans the column up while the old, looser definition is
still in place: rows that are
NULLor empty get yourConfig.DefaultGarage, values longer than 60 characters are shortened to fit, and only then is the column tightened. On a healthy database the cleanup matches no rows and costs nothing.
Changed
- The vehicle type table moved from
server/vehicles.luatoserver/main.lua. This is a pure reorganisation. The mapping from thetypecolumn inowned_vehiclesto the typeCreateVehicleServerSetterexpects is unchanged and behaves exactly as before.
Nothing to do by hand
There is no SQL for you to run. The cleanup is part of the boot migration and runs on every start, so a database that ends up with empty values later repairs itself on the next restart. No rebuild and no database change, replace the resource files and restart it.
Want to know which case you had?
Run this against your database before the update to see what the migration was choking on:
SELECT SUM(`garage` IS NULL) AS nulls,
SUM(CHAR_LENGTH(`garage`) > 60) AS too_long
FROM owned_vehicles;
Rows counted in nulls came from a garage column that was created as nullable, rows in
too_long from one that was wider than 60 characters. Both are handled now.
Changed files
fxmanifest.lua
server/main.lua
server/vehicles.lua