mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-17 07:33:57 +00:00
(fix) handle 9 tables structure in v4 update scripts
This commit is contained in:
@@ -17,6 +17,7 @@ if [ -z "$indextable" ]; then
|
||||
echo "Couldn't fetch OCSFolderInfoURL value, aborting" >&2
|
||||
exit 1
|
||||
fi
|
||||
storeurl=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
|
||||
read -p "Username ($defaultusername): " username
|
||||
read -p "Hostname ($defaulthostname): " hostname
|
||||
@@ -71,7 +72,12 @@ echo "Converting c_content from TEXT to LONGTEXT in the sogo_user_profile table"
|
||||
growUserProfile
|
||||
|
||||
echo "Converting c_mail from VARCHAR(255) to TEXT in Contacts quick tables" >&2
|
||||
if [ -z "$storeurl" ]; then
|
||||
tables=`mysql -p -s -u $username -h $hostname $database -e "select SUBSTRING_INDEX(c_quick_location, '/', -1) from $indextable where c_path3 = 'Contacts';"`
|
||||
else
|
||||
tables="sogo_quick_contact"
|
||||
fi
|
||||
|
||||
for table in $tables;
|
||||
do
|
||||
growMailInContactsQuick
|
||||
|
||||
@@ -15,6 +15,7 @@ if [ -z "$indextable" ]; then
|
||||
echo "Couldn't fetch OCSFolderInfoURL value, aborting" >&2
|
||||
exit 1
|
||||
fi
|
||||
storeurl=$(sogo-tool dump-defaults -f /etc/sogo/sogo.conf | awk -F\" '/ OCSStoreURL =/ {print $2}' | awk -F/ '{print $NF}')
|
||||
|
||||
read -p "Username ($defaultusername): " username
|
||||
read -p "Hostname ($defaulthostname): " hostname
|
||||
@@ -53,7 +54,11 @@ function addCertificateInContactsQuick() {
|
||||
|
||||
echo "This script will ask for the database password twice" >&2
|
||||
echo "Converting c_mail from VARCHAR(255) to TEXT in Contacts quick tables" >&2
|
||||
if [ -z "$storeurl" ]; then
|
||||
tables=`psql -t -U $username -h $hostname $database -c "select split_part(c_quick_location, '/', 5) from $indextable where c_path3 = 'Contacts';"`
|
||||
else
|
||||
tables="sogo_quick_contact"
|
||||
fi
|
||||
|
||||
for table in $tables;
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user