From 1cb67f545e1a6067645923e872bea48f92e9374e Mon Sep 17 00:00:00 2001 From: Chad Furman Date: Mon, 8 Jul 2024 20:25:46 -0400 Subject: [PATCH] using migrations for alter table command --- setup/migrate.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/setup/migrate.py b/setup/migrate.py index 94bea923..3d76aabc 100755 --- a/setup/migrate.py +++ b/setup/migrate.py @@ -190,6 +190,13 @@ def migration_14(env): db = os.path.join(env["STORAGE_ROOT"], 'mail/users.sqlite') shell("check_call", ["sqlite3", db, "CREATE TABLE auto_aliases (id INTEGER PRIMARY KEY AUTOINCREMENT, source TEXT NOT NULL UNIQUE, destination TEXT NOT NULL, permitted_senders TEXT);"]) +def migration_15(env): + # Add a column to the users table to store their quota limit. Default to '0' for unlimited. + db = os.path.join(env["STORAGE_ROOT"], 'mail/users.sqlite') + shell("check_call", ["sqlite3", db, + "ALTER TABLE users ADD COLUMN quota TEXT NOT NULL DEFAULT '0';"]) + + ########################################################### def get_current_migration():