diff roundup/backends/back_sqlite.py @ 3309:088c1792b7f6 maint-0.8

merge from maint-0-7
author Richard Jones <richard@users.sourceforge.net>
date Mon, 02 May 2005 05:48:59 +0000
parents 43675a5232b1
children
line wrap: on
line diff
--- a/roundup/backends/back_sqlite.py	Mon May 02 00:45:14 2005 +0000
+++ b/roundup/backends/back_sqlite.py	Mon May 02 05:48:59 2005 +0000
@@ -1,4 +1,4 @@
-# $Id: back_sqlite.py,v 1.36.2.4 2005-02-14 04:37:37 richard Exp $
+# $Id: back_sqlite.py,v 1.36.2.5 2005-05-02 05:47:53 richard Exp $
 '''Implements a backend for SQLite.
 
 See https://pysqlite.sourceforge.net/ for pysqlite info
@@ -325,12 +325,19 @@
     def setid(self, classname, setid):
         ''' Set the id counter: used during import of database
 
-        We add one to make it behave like the seqeunces in postgres.
+        We add one to make it behave like the sequences in postgres.
         '''
         sql = 'update ids set num=%s where name=%s'%(self.arg, self.arg)
         vals = (int(setid)+1, classname)
         self.sql(sql, vals)
 
+    def clear(self):
+        rdbms_common.Database.clear(self)
+
+        # set the id counters to 0 (setid adds one) so we start at 1
+        for cn in self.classes.keys():
+            self.setid(cn, 0)
+
     def create_class(self, spec):
         rdbms_common.Database.create_class(self, spec)
         sql = 'insert into ids (name, num) values (%s, %s)'

Roundup Issue Tracker: http://roundup-tracker.org/