IF NOT EXISTS is not present in some sqlite
versions
This commit is contained in:
parent
58f7a20e91
commit
e75425a660
1 changed files with 15 additions and 1 deletions
|
@ -37,7 +37,21 @@ from pysqlite2 import dbapi2 as sqlite # DO NOT MOVE ABOVE OF import gajim
|
||||||
|
|
||||||
def assert_um_exists():
|
def assert_um_exists():
|
||||||
''' create table unread_messages if there is no such table '''
|
''' create table unread_messages if there is no such table '''
|
||||||
pass
|
con = sqlite.connect(logger.LOG_DB_PATH)
|
||||||
|
cur = con.cursor()
|
||||||
|
cur.executescript(
|
||||||
|
'''
|
||||||
|
CREATE TABLE unread_messages (
|
||||||
|
message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE
|
||||||
|
);
|
||||||
|
'''
|
||||||
|
)
|
||||||
|
try:
|
||||||
|
con.commit()
|
||||||
|
gajim.logger.init_vars()
|
||||||
|
except sqlite.OperationalError, e:
|
||||||
|
pass
|
||||||
|
con.close()
|
||||||
|
|
||||||
def create_log_db():
|
def create_log_db():
|
||||||
print _('creating logs database')
|
print _('creating logs database')
|
||||||
|
|
Loading…
Add table
Reference in a new issue