Skip to content
Snippets Groups Projects
Commit 52827c6a authored by Philipp Hörist's avatar Philipp Hörist
Browse files

Add new DB table last_archive_message

parent 536a504f
No related branches found
No related tags found
No related merge requests found
import subprocess
__version__ = "0.16.11.1"
__version__ = "0.16.11.2"
try:
node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
......
......@@ -80,6 +80,13 @@ def create_log_db():
marker INTEGER
);
CREATE TABLE last_archive_message(
jid_id INTEGER PRIMARY KEY UNIQUE,
last_mam_id TEXT,
oldest_mam_timestamp TEXT,
last_muc_timestamp TEXT
);
CREATE INDEX idx_logs_jid_id_time ON logs (jid_id, time DESC);
'''
)
......
......@@ -242,6 +242,8 @@ class OptionsParser:
self.update_config_to_016105()
if old < [0, 16, 11, 1] and new >= [0, 16, 11, 1]:
self.update_config_to_016111()
if old < [0, 16, 11, 2] and new >= [0, 16, 11, 2]:
self.update_config_to_016112()
app.logger.init_vars()
app.logger.attach_cache_database()
......@@ -1029,3 +1031,23 @@ class OptionsParser:
log.exception('Error')
con.close()
app.config.set('version', '0.16.11.1')
def update_config_to_016112(self):
con = sqlite.connect(logger.LOG_DB_PATH)
cur = con.cursor()
try:
cur.executescript(
'''
CREATE TABLE IF NOT EXISTS last_archive_message(
jid_id INTEGER PRIMARY KEY UNIQUE,
last_mam_id TEXT,
oldest_mam_timestamp TEXT,
last_muc_timestamp TEXT
);
'''
)
con.commit()
except sqlite.OperationalError:
log.exception('Error')
con.close()
app.config.set('version', '0.16.11.2')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment