hamster-applet r641 - trunk/hamster
- From: tbaugis svn gnome org
- To: svn-commits-list gnome org
- Subject: hamster-applet r641 - trunk/hamster
- Date: Mon, 24 Nov 2008 19:13:09 +0000 (UTC)
Author: tbaugis
Date: Mon Nov 24 19:13:09 2008
New Revision: 641
URL: http://svn.gnome.org/viewvc/hamster-applet?rev=641&view=rev
Log:
do version update only if we have a newer one
Modified:
trunk/hamster/db.py
Modified: trunk/hamster/db.py
==============================================================================
--- trunk/hamster/db.py (original)
+++ trunk/hamster/db.py Mon Nov 24 19:13:09 2008
@@ -513,6 +513,7 @@
"""upgrade DB to hamster version"""
version = self.fetchone("SELECT version FROM version")["version"]
+ current_version = 5
if version < 2:
"""moving from fact_date, fact_time to start_time, end_time"""
@@ -677,9 +678,13 @@
if version < 5:
self.execute("ALTER TABLE facts add column description varchar2")
- #lock down current version
- self.execute("UPDATE version SET version = 5")
+
+ # at the happy end, update version number
+ if version < current_version:
+ #lock down current version
+ self.execute("UPDATE version SET version = %d") % current_version
+
"""we start with an empty database and then populate with default
values. This way defaults can be localized!"""
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]