diff --git a/gramps/plugins/db/bsddb/upgrade.py b/gramps/plugins/db/bsddb/upgrade.py index e111357b2..bd1593d79 100644 --- a/gramps/plugins/db/bsddb/upgrade.py +++ b/gramps/plugins/db/bsddb/upgrade.py @@ -77,6 +77,17 @@ def gramps_upgrade_pickle(self): with BSDDBTxn(self.env, self.metadata) as txn: txn.put(b'upgraded', 'Yes') +def gramps_upgrade_19(self): + """ + Upgrade database from version 18 to 19. + """ + default_handle = self.metadata.get(b'default') + with BSDDBTxn(self.env, self.metadata) as txn: + if default_handle is not None: + default_handle = default_handle.decode('utf-8') + txn.put(b'default', default_handle) + txn.put(b'version', 19) + def gramps_upgrade_18(self): """ Upgrade database from version 17 to 18. diff --git a/gramps/plugins/db/bsddb/write.py b/gramps/plugins/db/bsddb/write.py index 34623a9b8..5bdcd5455 100644 --- a/gramps/plugins/db/bsddb/write.py +++ b/gramps/plugins/db/bsddb/write.py @@ -87,7 +87,7 @@ LOG = logging.getLogger(".citation") #_hdlr.setFormatter(logging.Formatter(fmt="%(name)s.%(levelname)s: %(message)s")) #_LOG.addHandler(_hdlr) _MINVERSION = 9 -_DBVERSION = 18 +_DBVERSION = 19 IDTRANS = "person_id" FIDTRANS = "family_id" @@ -2159,6 +2159,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): upgrade.gramps_upgrade_17(self) if version < 18: upgrade.gramps_upgrade_18(self) + if version < 19: + upgrade.gramps_upgrade_19(self) self.reset() self.set_total(6)