From 70da8ae01182fc79de1e63c3a4ef2294dd5f26f7 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Wed, 19 Apr 2006 08:53:27 +0000 Subject: [PATCH] fix db creation --- src/common/check_paths.py | 5 ++++- src/migrate_logs_to_dot9_db.py | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/common/check_paths.py b/src/common/check_paths.py index 18c0bdca1..396db51da 100644 --- a/src/common/check_paths.py +++ b/src/common/check_paths.py @@ -57,7 +57,8 @@ def create_log_db(): ); CREATE TABLE unread_messages( - message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE + message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, + jid_id INTEGER ); CREATE TABLE logs( @@ -74,6 +75,7 @@ def create_log_db(): ) con.commit() + con.close() def check_and_possibly_create_paths(): LOG_DB_PATH = logger.LOG_DB_PATH @@ -105,6 +107,7 @@ def check_and_possibly_create_paths(): if not os.path.exists(LOG_DB_PATH): create_log_db() + gajim.logger.init_vars() elif os.path.isdir(LOG_DB_PATH): print _('%s is directory but should be file') % LOG_DB_PATH print _('Gajim will now exit') diff --git a/src/migrate_logs_to_dot9_db.py b/src/migrate_logs_to_dot9_db.py index 94281cd4d..7566dd91c 100755 --- a/src/migrate_logs_to_dot9_db.py +++ b/src/migrate_logs_to_dot9_db.py @@ -217,7 +217,12 @@ class Migration: jid TEXT UNIQUE, type INTEGER ); - + + CREATE TABLE unread_messages( + message_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, + jid_id INTEGER + ); + CREATE TABLE logs( log_line_id INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE, jid_id INTEGER,