diff roundup/backends/back_gadfly.py @ 974:84216d63ed9c

ahhh, I understand now
author Richard Jones <richard@users.sourceforge.net>
date Fri, 23 Aug 2002 04:58:00 +0000
parents ca0a542b2d19
children 2ab4d496d936
line wrap: on
line diff
--- a/roundup/backends/back_gadfly.py	Fri Aug 23 04:48:36 2002 +0000
+++ b/roundup/backends/back_gadfly.py	Fri Aug 23 04:58:00 2002 +0000
@@ -1,4 +1,4 @@
-# $Id: back_gadfly.py,v 1.2 2002-08-23 04:48:10 richard Exp $
+# $Id: back_gadfly.py,v 1.3 2002-08-23 04:58:00 richard Exp $
 __doc__ = '''
 About Gadfly
 ============
@@ -710,8 +710,7 @@
         return res
 
     def pack(self, pack_before):
-        ''' Pack the database, removing all journal entries before the
-            "pack_before" date.
+        ''' Delete all journal entries except "create" before 'pack_before'.
         '''
         # get a 'yyyymmddhhmmss' version of the date
         date_stamp = pack_before.serialise()
@@ -719,7 +718,8 @@
         # do the delete
         cursor = self.conn.cursor()
         for classname in self.classes.keys():
-            sql = 'delete from %s__journal where date<?'%classname
+            sql = "delete from %s__journal where date<? and "\
+                "action<>'create'"%classname
             if __debug__:
                 print >>hyperdb.DEBUG, 'pack', (self, sql, date_stamp)
             cursor.execute(sql, (date_stamp,))
@@ -1645,6 +1645,20 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.2  2002/08/23 04:48:10  richard
+# That's gadfly done, mostly. Things left:
+# - Class.filter (I'm a wuss ;)
+# - schema changes adding new non-multilink properties are not implemented.
+#   gadfly doesn't have an ALTER TABLE command, making that quite difficult :)
+#
+# I had to mangle two unit tests to get this all working:
+# - gadfly also can't handle two handles open on the one database, so
+#   testIDGeneration doesn't try that.
+# - testNewProperty is disabled as per the second comment above.
+#
+# I noticed test_pack was incorrect, and the *dbm tests fail there now.
+# Looking into it...
+#
 # Revision 1.1  2002/08/22 07:56:51  richard
 # Whee! It's not finished yet, but I can create a new instance and play with
 # it a little bit :)

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