Commit d874676e authored by Philipp Hörist's avatar Philipp Hörist

Merge branch 'sql' into 'master'

Add new Columns to Logs.db

See merge request !66
parents 55561b3d c75c45bc
......@@ -72,7 +72,12 @@ def create_log_db():
show INTEGER,
message TEXT,
subject TEXT,
additional_data TEXT DEFAULT '{}'
additional_data TEXT DEFAULT '{}',
stanza_id TEXT,
mam_id TEXT,
encryption TEXT,
encryption_state TEXT,
marker INTEGER
);
CREATE INDEX idx_logs_jid_id_time ON logs (jid_id, time DESC);
......
......@@ -30,7 +30,7 @@ import os.path
docdir = '../'
basedir = '../'
localedir = '../po'
version = '0.16.10.2'
version = '0.16.10.3'
try:
node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
......
......@@ -234,6 +234,8 @@ class OptionsParser:
self.update_config_to_016101()
if old < [0, 16, 10, 2] and new >= [0, 16, 10, 2]:
self.update_config_to_016102()
if old < [0, 16, 10, 3] and new >= [0, 16, 10, 3]:
self.update_config_to_016103()
gajim.logger.init_vars()
gajim.logger.attach_cache_database()
......@@ -975,3 +977,25 @@ class OptionsParser:
con.close()
gajim.config.set('version', '0.16.10.2')
def update_config_to_016103(self):
back = os.getcwd()
os.chdir(logger.LOG_DB_FOLDER)
con = sqlite.connect(logger.LOG_DB_FILE)
os.chdir(back)
cur = con.cursor()
try:
cur.executescript(
'''
ALTER TABLE logs ADD COLUMN 'stanza_id' TEXT;
ALTER TABLE logs ADD COLUMN 'mam_id' TEXT;
ALTER TABLE logs ADD COLUMN 'encryption' TEXT;
ALTER TABLE logs ADD COLUMN 'encryption_state' TEXT;
ALTER TABLE logs ADD COLUMN 'marker' INTEGER;
'''
)
con.commit()
except sqlite.OperationalError:
pass
con.close()
gajim.config.set('version', '0.16.10.3')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment