commit after each query
This commit is contained in:
parent
01a9da1e35
commit
a9199bf921
|
@ -39,6 +39,7 @@ def assert_unread_msgs_table_exists():
|
||||||
'''create table unread_messages if there is no such table'''
|
'''create table unread_messages if there is no such table'''
|
||||||
con = sqlite.connect(logger.LOG_DB_PATH)
|
con = sqlite.connect(logger.LOG_DB_PATH)
|
||||||
cur = con.cursor()
|
cur = con.cursor()
|
||||||
|
needs_init_vars = False
|
||||||
try:
|
try:
|
||||||
cur.executescript(
|
cur.executescript(
|
||||||
'''
|
'''
|
||||||
|
@ -49,12 +50,20 @@ def assert_unread_msgs_table_exists():
|
||||||
'''
|
'''
|
||||||
)
|
)
|
||||||
con.commit()
|
con.commit()
|
||||||
#FIXME: remove before release 0.10, it's temporary
|
needs_init_vars = True
|
||||||
cur.executescript('ALTER TABLE unread_messages ADD jid_id;')
|
|
||||||
con.commit()
|
|
||||||
gajim.logger.init_vars()
|
|
||||||
except sqlite.OperationalError, e:
|
except sqlite.OperationalError, e:
|
||||||
pass
|
pass
|
||||||
|
# add column jid_id. if there is such column do nothing
|
||||||
|
try:
|
||||||
|
#FIXME: remove before release 0.10, it's temporary
|
||||||
|
cur.executescript('ALTER TABLE unread_messages ADD jid_id INTEGER;')
|
||||||
|
con.commit()
|
||||||
|
needs_init_vars = True
|
||||||
|
except sqlite.OperationalError, e:
|
||||||
|
pass
|
||||||
|
|
||||||
|
if needs_init_vars:
|
||||||
|
gajim.logger.init_vars()
|
||||||
con.close()
|
con.close()
|
||||||
|
|
||||||
def create_log_db():
|
def create_log_db():
|
||||||
|
|
Loading…
Reference in New Issue