Fix bug with quota field detection (#97)
* Fix bug with quota field detection This is related to Issue #96 "Upgrade to v60.4 fails" * Update setup/mail-users.sh sqlite_schema isn't supported everywhere yet Co-authored-by: David Duque <github@duqued.net>
This commit is contained in:
parent
748adfebd9
commit
9215b011f8
1 changed files with 5 additions and 2 deletions
|
@ -25,9 +25,12 @@ if [ ! -f $db_path ]; then
|
|||
echo "CREATE TABLE noreply (id INTEGER PRIMARY KEY AUTOINCREMENT, email TEXT NOT NULL UNIQUE);" | sqlite3 $db_path
|
||||
echo "CREATE TABLE mfa (id INTEGER PRIMARY KEY AUTOINCREMENT, user_id INTEGER NOT NULL, type TEXT NOT NULL, secret TEXT NOT NULL, mru_token TEXT, label TEXT, FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE);" | sqlite3 $db_path;
|
||||
echo "CREATE TABLE auto_aliases (id INTEGER PRIMARY KEY AUTOINCREMENT, source TEXT NOT NULL UNIQUE, destination TEXT NOT NULL, permitted_senders TEXT);" | sqlite3 $db_path;
|
||||
elif sqlite3 $db_path ".schema users" | grep --invert-match quota; then
|
||||
else
|
||||
sql=$(sqlite3 $db_path "SELECT sql FROM sqlite_master WHERE name = 'users'");
|
||||
if echo $sql | grep --invert-match quota; then
|
||||
echo "ALTER TABLE users ADD COLUMN quota TEXT NOT NULL DEFAULT '0';" | sqlite3 $db_path;
|
||||
fi
|
||||
fi
|
||||
|
||||
# Recover the database if it was hit by the Roundcube password changer "bug" (#85)
|
||||
# If the journal_mode is set to wal, postfix cannot read it and we wouldn't
|
||||
|
|
Loading…
Reference in a new issue