From b8d6c7f0739fd6514fa73ab4a6e3965a5bba78b3 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Wed, 28 Oct 2026 13:30:10 -0500 Subject: [PATCH] Schema: widen the user name columns on servers upgraded from 1.5 Step 279 widens users.uName and users.uCreateBy from 1.5's VARCHAR(40) NOT NULL to VARCHAR(255) NULL. A 1.5.x server arrives with a count past 279 and skips it, and SchemaReconciler never retypes an existing column. So an upgraded server kept a 40-character user name, where a fresh install allows 255. Step 446 repeats the ALTER. Widening keeps every stored value, and on a server that already ran 279 it changes nothing. Refs #2000 Co-Authored-By: Claude Opus 5.5 --- packages/web/commons/schema.php | 12 ++++++++++++ packages/web/src/Base/System.php | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/web/commons/schema.php b/packages/web/commons/schema.php index a23bcdf695..aabc2fc9bd 100644 --- a/packages/web/commons/schema.php +++ b/packages/web/commons/schema.php @@ -12064,3 +12064,15 @@ function () { . "physical memory. (Default 275000)' " . "WHERE `settingKey` = 'FOG_KERNEL_RAMDISK_SIZE'", ]; +// 446 +$this->schema[] = [ + // Step 279 again. It widened these two columns from 1.5's + // VARCHAR(40) NOT NULL, but a 1.5.x server carries a count past 279 and + // skips it, and SchemaReconciler never retypes an existing column. So an + // upgraded server kept the 40-character limit that a fresh install does + // not have (GH-2000). Widening keeps every stored value, and on a server + // that already ran 279 this changes nothing. + "ALTER TABLE `users` " + . "MODIFY `uName` VARCHAR(255)," + . "MODIFY `uCreateBy` VARCHAR(255)" +]; diff --git a/packages/web/src/Base/System.php b/packages/web/src/Base/System.php index 47143a7ab8..f3e4476bfd 100644 --- a/packages/web/src/Base/System.php +++ b/packages/web/src/Base/System.php @@ -130,7 +130,7 @@ public function __construct() // 1.5.x carried count does, see SchemaReconciler's docstring -- is // permanently "up to date" from the updater's point of view and will // never run another indexed step, whatever this constant says. - define('FOG_SCHEMA', 445); + define('FOG_SCHEMA', 446); define('FOG_BCACHE_VER', 370); define('FOG_CLIENT_VERSION', '0.13.0'); // GH-959: iPXE lives in FOGProject/fog-ipxe and its binaries arrive as