added upgrade scripts for 7.10.33 including upgrade to mysql 8.x

This commit is contained in:
Joeri de Bruin 2026-02-25 17:28:31 +01:00
parent 45a78c182f
commit e07af2eb65
4 changed files with 12 additions and 23 deletions

View file

@ -20,20 +20,12 @@ for configfile in `perl -Ilib sbin/wgd for-each`;do
echo "code version $code_version" echo "code version $code_version"
echo "database version $db_version for $configfile" 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 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/ 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 ## 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 done
#perl -I/data/WebGUI/lib sbin/spectre.pl --daemon perl -I/data/WebGUI/lib sbin/spectre.pl --daemon
service apache2 start
while true; do
echo "Starting Apache web server..."
sleep 60
done
apachectl -DFOREGROUND apachectl -DFOREGROUND

View file

@ -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 7.10.32
- fixed: Bad asset redirect from AssetTrash www_delete if encryptPage is set - fixed: Bad asset redirect from AssetTrash www_delete if encryptPage is set

View file

@ -1,7 +1,7 @@
package WebGUI; package WebGUI;
our $VERSION = '7.10.32'; our $VERSION = '7.10.33';
our $STATUS = 'stable'; our $STATUS = 'stable';

View file

@ -13,6 +13,7 @@
use strict; use strict;
use File::Basename (); use File::Basename ();
use File::Spec; use File::Spec;
use lib '.';
my $webguiRoot; my $webguiRoot;
BEGIN { BEGIN {
@ -132,8 +133,8 @@ foreach my $filename (keys %{$configs}) {
$config{$filename}{mysqlCLI} = $configs->{$filename}->get("mysqlCLI"); $config{$filename}{mysqlCLI} = $configs->{$filename}->get("mysqlCLI");
$config{$filename}{mysqlDump} = $configs->{$filename}->get("mysqlDump"); $config{$filename}{mysqlDump} = $configs->{$filename}->get("mysqlDump");
$config{$filename}{backupPath} = $configs->{$filename}->get("backupPath"); $config{$filename}{backupPath} = $configs->{$filename}->get("backupPath");
my $session = WebGUI::Session->open($webguiRoot,$filename); my $session = WebGUI::Session->open($webguiRoot, $filename, undef, undef, undef, 1);
($config{$filename}{version}) = $session->db->quickArray("select webguiVersion from webguiVersion order by ($config{$filename}{version}) = $session->db->quickArray("select webguiVersion from webguiVersion order by
dateApplied desc, length(webguiVersion) desc, webguiVersion desc limit 1"); dateApplied desc, length(webguiVersion) desc, webguiVersion desc limit 1");
unless ($history) { unless ($history) {
print "\tPreparing site for upgrade.\n" unless ($quiet); print "\tPreparing site for upgrade.\n" unless ($quiet);