* src/GrampsDb/_GrampsBSDDB.py: upgrade from gramps20.

svn: r5790
This commit is contained in:
Alex Roitman 2006-01-18 22:02:24 +00:00
parent e22e5cf09a
commit 8fbe67e6b0
2 changed files with 18 additions and 7 deletions

View File

@ -8,6 +8,7 @@
* src/GrampsDb/_ReadGedcom.py (parse_record): Restore add def_src. * src/GrampsDb/_ReadGedcom.py (parse_record): Restore add def_src.
* src/GrampsDb/_GrampsBSDDB.py (rebuild_secondary): Proper * src/GrampsDb/_GrampsBSDDB.py (rebuild_secondary): Proper
rebuild; convert surnames secondary index to DUPSORTed BTREE. rebuild; convert surnames secondary index to DUPSORTed BTREE.
* src/GrampsDb/_GrampsBSDDB.py: upgrade from gramps20.
2006-01-17 Don Allingham <don@gramps-project.org> 2006-01-17 Don Allingham <don@gramps-project.org>
* src/DbPrompter.py: removed * src/DbPrompter.py: removed

View File

@ -292,10 +292,21 @@ class GrampsBSDDB(GrampsDbBase):
else: else:
table_flags = db.DB_CREATE|db.DB_AUTO_COMMIT table_flags = db.DB_CREATE|db.DB_AUTO_COMMIT
# Try to upgrade from gramps20
# that had HASH for surnames table
try:
self.surnames = db.DB(self.env) self.surnames = db.DB(self.env)
self.surnames.set_flags(db.DB_DUP|db.DB_DUPSORT) self.surnames.set_flags(db.DB_DUP|db.DB_DUPSORT)
self.surnames.open(self.full_name, "surnames", self.surnames.open(self.full_name, "surnames",
db.DB_BTREE, flags=table_flags) db.DB_BTREE, flags=table_flags)
except db.DBInvalidArgError:
self.surnames.close()
junk = db.DB(self.env)
junk.remove(self.full_name,"surnames")
self.surnames = db.DB(self.env)
self.surnames.set_flags(db.DB_DUP|db.DB_DUPSORT)
self.surnames.open(self.full_name, "surnames", db.DB_BTREE,
flags=table_flags)
self.name_group = db.DB(self.env) self.name_group = db.DB(self.env)
self.name_group.set_flags(db.DB_DUP) self.name_group.set_flags(db.DB_DUP)
@ -1200,9 +1211,8 @@ class GrampsBSDDB(GrampsDbBase):
pass pass
# The rest of the upgrade deals with real data, not metadata # The rest of the upgrade deals with real data, not metadata
# so starting transaction here. # so starting (batch) transaction here.
trans = Transaction("",self) trans = self.transaction_begin("",True)
trans.set_batch(True)
# This upgrade adds marker to every primary object. # This upgrade adds marker to every primary object.
# We need to extract and commit every primary object # We need to extract and commit every primary object