drop may fail, we still have to create the

table
This commit is contained in:
Dimitur Kirov 2006-04-19 10:47:29 +00:00
parent f4a203d5bc
commit 7f369eb127
1 changed files with 13 additions and 7 deletions

View File

@ -241,13 +241,19 @@ class Logger:
results = self.cur.fetchall()
# Remove before 0.10
except:
self.cur.executescript('DROP TABLE unread_messages;')
self.con.commit()
self.cur.executescript('''CREATE TABLE unread_messages(
message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
jid_id INTEGER
);''')
self.con.commit()
try:
self.cur.executescript('DROP TABLE unread_messages;')
self.con.commit()
except:
pass
try:
self.cur.executescript('''CREATE TABLE unread_messages(
message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
jid_id INTEGER
);''')
self.con.commit()
except:
pass
self.con.close()
self.jids_already_in = []
self.init_vars()