Database upgrade to convert default handle to str
This commit is contained in:
parent
5939e722e4
commit
16cd995558
@ -77,6 +77,17 @@ def gramps_upgrade_pickle(self):
|
|||||||
with BSDDBTxn(self.env, self.metadata) as txn:
|
with BSDDBTxn(self.env, self.metadata) as txn:
|
||||||
txn.put(b'upgraded', 'Yes')
|
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):
|
def gramps_upgrade_18(self):
|
||||||
"""
|
"""
|
||||||
Upgrade database from version 17 to 18.
|
Upgrade database from version 17 to 18.
|
||||||
|
@ -87,7 +87,7 @@ LOG = logging.getLogger(".citation")
|
|||||||
#_hdlr.setFormatter(logging.Formatter(fmt="%(name)s.%(levelname)s: %(message)s"))
|
#_hdlr.setFormatter(logging.Formatter(fmt="%(name)s.%(levelname)s: %(message)s"))
|
||||||
#_LOG.addHandler(_hdlr)
|
#_LOG.addHandler(_hdlr)
|
||||||
_MINVERSION = 9
|
_MINVERSION = 9
|
||||||
_DBVERSION = 18
|
_DBVERSION = 19
|
||||||
|
|
||||||
IDTRANS = "person_id"
|
IDTRANS = "person_id"
|
||||||
FIDTRANS = "family_id"
|
FIDTRANS = "family_id"
|
||||||
@ -2159,6 +2159,8 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
|
|||||||
upgrade.gramps_upgrade_17(self)
|
upgrade.gramps_upgrade_17(self)
|
||||||
if version < 18:
|
if version < 18:
|
||||||
upgrade.gramps_upgrade_18(self)
|
upgrade.gramps_upgrade_18(self)
|
||||||
|
if version < 19:
|
||||||
|
upgrade.gramps_upgrade_19(self)
|
||||||
|
|
||||||
self.reset()
|
self.reset()
|
||||||
self.set_total(6)
|
self.set_total(6)
|
||||||
|
Loading…
Reference in New Issue
Block a user