From e07af2eb65be72c829ff2987081d23e313fa04a3 Mon Sep 17 00:00:00 2001 From: Joeri de Bruin Date: Wed, 25 Feb 2026 17:28:31 +0100 Subject: [PATCH] added upgrade scripts for 7.10.33 including upgrade to mysql 8.x --- distribution/webgui/entrypoint | 25 +++++-------------------- docs/changelog/7.x.x.txt | 3 +++ lib/WebGUI.pm | 2 +- sbin/upgrade.pl | 5 +++-- 4 files changed, 12 insertions(+), 23 deletions(-) diff --git a/distribution/webgui/entrypoint b/distribution/webgui/entrypoint index 5cafb3236..7493bd7b6 100644 --- a/distribution/webgui/entrypoint +++ b/distribution/webgui/entrypoint @@ -20,20 +20,12 @@ for configfile in `perl -Ilib sbin/wgd for-each`;do echo "code version $code_version" echo "database version $db_version for $configfile" - #this table shoud have a defult value. Shoud be in upgrade.pl to new version - `mysql -e 'alter table userSession MODIFY COLUMN userId char(22) NOT NULL DEFAULT "0";' $connection_info ` && break - `mysql -e 'alter table assetVersionTag MODIFY COLUMN name char(255) NOT NULL DEFAULT "default";' $connection_info ` && break - `mysql -e 'alter table assetVersionTag MODIFY COLUMN createdBy char(22) NOT NULL DEFAULT "3";' $connection_info ` && break - `mysql -e 'alter table assetVersionTag MODIFY COLUMN committedBy char(22) NOT NULL DEFAULT "3";' $connection_info ` && break - `mysql -e 'alter table assetVersionTag MODIFY COLUMN lockedBy char(22) NOT NULL DEFAULT "3";' $connection_info ` && break - `mysql -e 'alter table assetVersionTag MODIFY COLUMN groupToUse char(22) NOT NULL DEFAULT "3";' $connection_info ` && break - `mysql -e 'alter table assetVersionTag MODIFY COLUMN workflowId char(22) NOT NULL DEFAULT "";' $connection_info ` && break - - `mysql -e 'alter table WorkflowInstance MODIFY COLUMN workflowId char(22) NOT NULL DEFAULT "";' $connection_info ` && break - `mysql -e 'alter table WorkflowInstance MODIFY COLUMN currentActivityId char(22) NOT NULL DEFAULT "";' $connection_info ` && break if [ "$db_version" != "$code_version" ];then + echo "Upgrading Webgui from $db_version to $code_version..." + #first we alter the userSession table to make sure that the userId has a default value This is required for the upgrade process to work correctly. + `mysql -e 'alter table userSession MODIFY COLUMN userId char(22) NOT NULL DEFAULT "0";' $connection_info ` && break + perl -Ilib sbin/wgd reset --upgrade --verbose --config-file=$configfile --webgui-root=/data/WebGUI/ - ### alter table userSession MODIFY COLUMN userId char(22) NOT NULL DEFAULT '0'; ## perl -Ilib sbin/wgd db --config-file=www.example.com --webgui-root=/data/WebGUI @@ -41,13 +33,6 @@ for configfile in `perl -Ilib sbin/wgd for-each`;do done -#perl -I/data/WebGUI/lib sbin/spectre.pl --daemon - -service apache2 start - -while true; do - echo "Starting Apache web server..." - sleep 60 -done +perl -I/data/WebGUI/lib sbin/spectre.pl --daemon apachectl -DFOREGROUND diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 294cb3438..cb79001f1 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,3 +1,6 @@ +7.10.33 + - fixed: Columns defined with 'NOT NULL' must have a default value in MySQL 8.x + 7.10.32 - fixed: Bad asset redirect from AssetTrash www_delete if encryptPage is set diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index bb9dcc814..28b106435 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -1,7 +1,7 @@ package WebGUI; -our $VERSION = '7.10.32'; +our $VERSION = '7.10.33'; our $STATUS = 'stable'; diff --git a/sbin/upgrade.pl b/sbin/upgrade.pl index 6827ac569..76487356d 100755 --- a/sbin/upgrade.pl +++ b/sbin/upgrade.pl @@ -13,6 +13,7 @@ use strict; use File::Basename (); use File::Spec; +use lib '.'; my $webguiRoot; BEGIN { @@ -132,8 +133,8 @@ foreach my $filename (keys %{$configs}) { $config{$filename}{mysqlCLI} = $configs->{$filename}->get("mysqlCLI"); $config{$filename}{mysqlDump} = $configs->{$filename}->get("mysqlDump"); $config{$filename}{backupPath} = $configs->{$filename}->get("backupPath"); - my $session = WebGUI::Session->open($webguiRoot,$filename); - ($config{$filename}{version}) = $session->db->quickArray("select webguiVersion from webguiVersion order by + my $session = WebGUI::Session->open($webguiRoot, $filename, undef, undef, undef, 1); + ($config{$filename}{version}) = $session->db->quickArray("select webguiVersion from webguiVersion order by dateApplied desc, length(webguiVersion) desc, webguiVersion desc limit 1"); unless ($history) { print "\tPreparing site for upgrade.\n" unless ($quiet);