1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2026-03-17 17:57:23 +01:00

make a privileges column in the users table and mark the first user as an admin

This commit is contained in:
Joshua Tauberer
2014-08-08 12:31:22 +00:00
parent 880ec44a0c
commit b56f82cb92
6 changed files with 103 additions and 15 deletions

View File

@@ -8,7 +8,7 @@
import sys, os, os.path, glob, re, shutil
sys.path.insert(0, 'management')
from utils import load_environment, save_environment, safe_domain_name
from utils import load_environment, save_environment, shell
def migration_1(env):
# Re-arrange where we store SSL certificates. There was a typo also.
@@ -51,6 +51,11 @@ def migration_3(env):
# of the file will be handled by the main function.
pass
def migration_4(env):
# Add a new column to the mail users table where we can store administrative privileges.
db = os.path.join(env["STORAGE_ROOT"], 'mail/users.sqlite')
shell("check_call", ["sqlite3", db, "ALTER TABLE users ADD privileges TEXT NOT NULL DEFAULT ''"])
def get_current_migration():
ver = 0
while True: