From 2a046557aca45a82094f3b641908907468c5d63a Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 24 Aug 2017 16:10:30 -0400 Subject: [PATCH] (fix) increased column size of settings/defaults for MySQL (fixes #4260) --- Documentation/SOGoInstallationGuide.asciidoc | 6 +++ NEWS | 1 + Scripts/sql-update-3.2.10_to_3.3.0-mysql.sh | 49 ++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100755 Scripts/sql-update-3.2.10_to_3.3.0-mysql.sh diff --git a/Documentation/SOGoInstallationGuide.asciidoc b/Documentation/SOGoInstallationGuide.asciidoc index 1242d3cca..9926e6173 100644 --- a/Documentation/SOGoInstallationGuide.asciidoc +++ b/Documentation/SOGoInstallationGuide.asciidoc @@ -2998,6 +2998,12 @@ current version of SOGo from the previous release. [cols="100a"] |======================================================================= +h|3.3.0 +|Run the shell script `sql-update-3.2.10_to_3.3.0.sh` if you are using MySQL. + +This will grow the "defaults" and "setting" fields of the SOGo user profile table +to a larger size. + h|2.3.1 |The SOGoCalendarDefaultCategoryColor default has been removed. If you want to customize the color of calendar categories, use the diff --git a/NEWS b/NEWS index 7fb9ca3cb..2e5fb1593 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ Enhancements Bug fixes - [core] yearly repeating events are not shown in web calendar (#4237) + - [core] increased column size of settings/defaults for MySQL (#4260) - [web] fixed display of error when the mail editor is in a popup - [web] attachments are not displayed on IOS (#4150) diff --git a/Scripts/sql-update-3.2.10_to_3.3.0-mysql.sh b/Scripts/sql-update-3.2.10_to_3.3.0-mysql.sh new file mode 100755 index 000000000..89c3ec255 --- /dev/null +++ b/Scripts/sql-update-3.2.10_to_3.3.0-mysql.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +set -e + +# This script only works with MySQL +# updates c_defaults and c_settings to longtext in the sogo_user_profile table +# to avoid truncation of data at 64k + + +defaultusername=$USER +defaulthostname=127.0.0.1 +defaultdatabase=sogo + +read -p "Username ($defaultusername): " username +read -p "Hostname ($defaulthostname): " hostname +read -p "Database ($defaultdatabase): " database + +if [ -z "$username" ] +then + username=$defaultusername +fi + +if [ -z "$hostname" ] +then + hostname=$defaulthostname +fi + +if [ -z "$database" ] +then + database=$defaultdatabase +fi + +sqlscript="" + +function growUserProfile() { + oldIFS="$IFS" + IFS=" " + part="`echo -e \"ALTER TABLE sogo_user_profile MODIFY c_defaults LONGTEXT;\\n\"`"; + sqlscript="$sqlscript$part" + part="`echo -e \"ALTER TABLE sogo_user_profile MODIFY c_settings LONGTEXT;\\n\"`"; + sqlscript="$sqlscript$part" + IFS="$oldIFS" +} + +echo "This script will ask for the sql password twice" >&2 +echo "Converting c_content from TEXT to LONGTEXT in the sogo_user_profile table" >&2 +growUserProfile + +echo "$sqlscript" | mysql -p -s -u $username -h $hostname $database