Database backend writes its plugin id in database.txt
This commit is contained in:
		| @@ -31,7 +31,8 @@ Declare constants used by database modules | |||||||
| __all__ = ( | __all__ = ( | ||||||
|             ('DBPAGE', 'DBMODE', 'DBCACHE', 'DBLOCKS', 'DBOBJECTS', 'DBUNDO', |             ('DBPAGE', 'DBMODE', 'DBCACHE', 'DBLOCKS', 'DBOBJECTS', 'DBUNDO', | ||||||
|              'DBEXT', 'DBMODE_R', 'DBMODE_W', 'DBUNDOFN', 'DBLOCKFN', |              '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', |             ('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 | DBLOCKFN  = "lock"          # File name of lock file | ||||||
| DBRECOVFN = "need_recover"  # File name of recovery file | DBRECOVFN = "need_recover"  # File name of recovery file | ||||||
| BDBVERSFN = "bdbversion.txt"# File name of Berkeley DB version 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 | SCHVERSFN = "schemaversion.txt"# File name of schema version file | ||||||
| PCKVERSFN = "pickleupgrade.txt" # Indicator that pickle has been upgrade t Python3 | PCKVERSFN = "pickleupgrade.txt" # Indicator that pickle has been upgrade t Python3 | ||||||
| DBLOGNAME = ".Db"           # Name of logger | DBLOGNAME = ".Db"           # Name of logger | ||||||
|   | |||||||
| @@ -2428,6 +2428,11 @@ class DbBsddb(DbBsddbRead, DbWriteBase, UpdateCallback): | |||||||
|             version = str(_DBVERSION) |             version = str(_DBVERSION) | ||||||
|             version_file.write(version) |             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.metadata.close() | ||||||
|         self.env.close() |         self.env.close() | ||||||
|    |    | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user