Add avatar_sha field to Cache DB
This commit is contained in:
parent
249e26feac
commit
68f13788ed
|
@ -1,6 +1,6 @@
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
__version__ = "0.16.11"
|
__version__ = "0.16.11.1"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
|
node = subprocess.Popen('git rev-parse --short=12 HEAD', shell=True,
|
||||||
|
|
|
@ -116,6 +116,7 @@ def create_cache_db():
|
||||||
name TEXT,
|
name TEXT,
|
||||||
subscription INTEGER,
|
subscription INTEGER,
|
||||||
ask BOOLEAN,
|
ask BOOLEAN,
|
||||||
|
avatar_sha TEXT,
|
||||||
PRIMARY KEY (account_jid_id, jid_id)
|
PRIMARY KEY (account_jid_id, jid_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -979,8 +979,11 @@ class Logger:
|
||||||
if name is None:
|
if name is None:
|
||||||
name = ''
|
name = ''
|
||||||
|
|
||||||
self.cur.execute('REPLACE INTO roster_entry VALUES(?, ?, ?, ?, ?)',
|
self.cur.execute('''
|
||||||
(account_jid_id, jid_id, name,
|
REPLACE INTO roster_entry
|
||||||
|
(account_jid_id, jid_id, name, subscription, ask)
|
||||||
|
VALUES(?, ?, ?, ?, ?)''', (
|
||||||
|
account_jid_id, jid_id, name,
|
||||||
self.convert_human_subscription_values_to_db_api_values(sub),
|
self.convert_human_subscription_values_to_db_api_values(sub),
|
||||||
bool(ask)))
|
bool(ask)))
|
||||||
if commit:
|
if commit:
|
||||||
|
|
|
@ -240,6 +240,8 @@ class OptionsParser:
|
||||||
self.update_config_to_016104()
|
self.update_config_to_016104()
|
||||||
if old < [0, 16, 10, 5] and new >= [0, 16, 10, 5]:
|
if old < [0, 16, 10, 5] and new >= [0, 16, 10, 5]:
|
||||||
self.update_config_to_016105()
|
self.update_config_to_016105()
|
||||||
|
if old < [0, 16, 11, 0] and new >= [0, 16, 11, 1]:
|
||||||
|
self.update_config_to_016111()
|
||||||
|
|
||||||
app.logger.init_vars()
|
app.logger.init_vars()
|
||||||
app.logger.attach_cache_database()
|
app.logger.attach_cache_database()
|
||||||
|
@ -1012,3 +1014,18 @@ class OptionsParser:
|
||||||
app.config.set('muc_restore_timeout', -1)
|
app.config.set('muc_restore_timeout', -1)
|
||||||
app.config.set('restore_timeout', -1)
|
app.config.set('restore_timeout', -1)
|
||||||
app.config.set('version', '0.16.10.5')
|
app.config.set('version', '0.16.10.5')
|
||||||
|
|
||||||
|
def update_config_to_016111(self):
|
||||||
|
con = sqlite.connect(logger.CACHE_DB_PATH)
|
||||||
|
cur = con.cursor()
|
||||||
|
try:
|
||||||
|
cur.executescript(
|
||||||
|
'''
|
||||||
|
ALTER TABLE roster_entry ADD COLUMN 'avatar_sha' TEXT;
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
con.commit()
|
||||||
|
except sqlite.OperationalError:
|
||||||
|
log.exception('Error')
|
||||||
|
con.close()
|
||||||
|
app.config.set('version', '0.16.11.1')
|
||||||
|
|
Loading…
Reference in New Issue