From: Vincent Bernat Date: Tue, 22 May 2007 20:16:24 +0000 (+0000) Subject: Upgrade for sqlite from 0.1-beta2.2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ec6f75099e848a48e6e45b58e625507aa430e74c;p=roundcube.git Upgrade for sqlite from 0.1-beta2.2 --- diff --git a/debian/postinst b/debian/postinst index b7996ff..3b09dcc 100644 --- a/debian/postinst +++ b/debian/postinst @@ -20,6 +20,56 @@ dbc_go roundcube $@ case "$1" in configure) + # From 0.1-beta2.2 to 0.1-rc1, a column was added to table + # `identities'. For MySQL and PostgreSQL, this is handled by + # dbconfig-common but for sqlite, there is no way to add a + # column to a table. Therefore, we dump here the table and add + # the column. + case "$dbc_dbtype" in + sqlite) + db="${dbc_basepath}/${dbc_dbname}" + # OK, we need to check if the table contains html_signature + if ! sqlite "$db" '.schema identities' | grep -q html_signature; then + # We need to add it + echo -n "Need to upgrade 'identities' table in $db... " + upgrade_tmp=$(mktemp -t roundcube.sqlite.XXXXXXXXXX) + ( + cat < $upgrade_tmp + sqlite "$db" < $upgrade_tmp + rm $upgrade_tmp + echo "OK" + fi + ;; + *) + # Do nothing + ;; + esac + CONFFILE=/etc/roundcube/main.inc.php touch $CONFFILE.ucftmp chmod 640 $CONFFILE.ucftmp