(fix) increased column size of settings/defaults for MySQL (fixes #4260)

pull/237/merge
Ludovic Marcotte 2017-08-24 16:10:30 -04:00
parent debe1f41f8
commit 2a046557ac
3 changed files with 56 additions and 0 deletions

View File

@ -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

1
NEWS
View File

@ -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)

View File

@ -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