From 483a22a13c62ded3ad1e7f66e88b901b985696b6 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Thu, 25 Jun 2026 11:20:10 -0500 Subject: [PATCH] fix: create SQL update file on Joomla version bump version_bump.php now creates an empty sql/updates/mysql/.sql file when bumping Joomla extensions. Prevents schema version mismatch in Joomla's Database view when no actual schema changes exist. --- cli/version_bump.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/cli/version_bump.php b/cli/version_bump.php index 3445a9a..0102d75 100644 --- a/cli/version_bump.php +++ b/cli/version_bump.php @@ -234,6 +234,20 @@ class VersionBumpCli extends CliFramework if (!empty($updatedFiles)) { fwrite(STDERR, "Updated " . count($updatedFiles) . " Joomla manifest(s): " . implode(', ', $updatedFiles) . "\n"); } + // Joomla schema version: create empty SQL update file if sql/updates/mysql/ exists + $sqlUpdateDirs = array_merge( + SourceResolver::globSource($root, 'packages/*/sql/updates/mysql'), + SourceResolver::globSource($root, 'sql/updates/mysql'), + glob("{$root}/sql/updates/mysql") ?: [] + ); + $sqlUpdateDirs = array_unique(array_filter($sqlUpdateDirs, 'is_dir')); + foreach ($sqlUpdateDirs as $sqlDir) { + $sqlFile = "{$sqlDir}/{$newBase}.sql"; + if (!file_exists($sqlFile)) { + file_put_contents($sqlFile, "/* {$newBase} — no schema changes */\n"); + fwrite(STDERR, "Created SQL update file: " . substr($sqlFile, strlen($root) + 1) . "\n"); + } + } $packageJsonFile = "{$root}/package.json"; if (file_exists($packageJsonFile)) { $pkgContent = file_get_contents($packageJsonFile); -- 2.52.0