Skip to content

Commit 5c96785

Browse files
author
Richard Jones
committed
*** empty log message ***
1 parent eb81a99 commit 5c96785

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

roundup/backends/back_mysql.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,18 @@ def setid(self, classname, setid):
496496
print >>hyperdb.DEBUG, 'setid', (self, sql, vals)
497497
self.cursor.execute(sql, vals)
498498

499+
def clear(self):
500+
'''Delete all database contents.
501+
502+
Note: I don't commit here, which is different behaviour to the
503+
"nuke from orbit" behaviour in the dbs.
504+
'''
505+
rdbms_common.Database.clear(self)
506+
507+
# set the id counters to 0 (setid adds one) so we start at 1
508+
for cn in self.classes.keys():
509+
self.setid(cn, 0)
510+
499511
def create_class(self, spec):
500512
rdbms_common.Database.create_class(self, spec)
501513
sql = 'insert into ids (name, num) values (%s, %s)'

0 commit comments

Comments
 (0)