Database backend writes its plugin id in database.txt

This commit is contained in:
Doug Blank 2015-05-12 23:08:54 -04:00
parent 7a7696224d
commit 81ebdd97cc
2 changed files with 8 additions and 1 deletions

View File

@ -31,7 +31,8 @@ Declare constants used by database modules
__all__ = (
('DBPAGE', 'DBMODE', 'DBCACHE', 'DBLOCKS', 'DBOBJECTS', 'DBUNDO',
'DBEXT', 'DBMODE_R', 'DBMODE_W', 'DBUNDOFN', 'DBLOCKFN',
'DBRECOVFN','BDBVERSFN', 'DBLOGNAME', 'SCHVERSFN', 'PCKVERSFN'
'DBRECOVFN','BDBVERSFN', 'DBLOGNAME', 'SCHVERSFN', 'PCKVERSFN',
'DBBACKEND'
) +
('PERSON_KEY', 'FAMILY_KEY', 'SOURCE_KEY', 'CITATION_KEY',
@ -47,6 +48,7 @@ DBUNDOFN = "undo.db" # File name of 'undo' database
DBLOCKFN = "lock" # File name of lock file
DBRECOVFN = "need_recover" # File name of recovery file
BDBVERSFN = "bdbversion.txt"# File name of Berkeley DB version file
DBBACKEND = "database.txt" # File name of Database backend file
SCHVERSFN = "schemaversion.txt"# File name of schema version file
PCKVERSFN = "pickleupgrade.txt" # Indicator that pickle has been upgrade t Python3
DBLOGNAME = ".Db" # Name of logger

View File

@ -2428,6 +2428,11 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback):
version = str(_DBVERSION)
version_file.write(version)
versionpath = os.path.join(name, str(DBBACKEND))
_LOG.debug("Write database backend file to 'bsddb'")
with open(versionpath, "w") as version_file:
version_file.write("bsddb")
self.metadata.close()
self.env.close()