Write dbapi schema version to metadata table instead of a file

This commit is contained in:
Nick Hall 2017-10-14 15:46:21 +01:00
parent 50091d1f86
commit 90495324e0
2 changed files with 1 additions and 5 deletions

View File

@ -599,6 +599,7 @@ class DbGeneric(DbWriteBase, DbReadBase, UpdateCallback, Callback):
# being new # being new
if not self.dbapi.table_exists("person"): if not self.dbapi.table_exists("person"):
self._create_schema() self._create_schema()
self._set_metadata('version', str(self.VERSION[0]))
# Load metadata # Load metadata
self.name_formats = self._get_metadata('name_formats') self.name_formats = self._get_metadata('name_formats')

View File

@ -55,11 +55,6 @@ class DBAPI(DbGeneric):
""" """
def write_version(self, directory): def write_version(self, directory):
"""Write files for a newly created DB.""" """Write files for a newly created DB."""
_LOG.debug("Write schema version file to %s", str(self.VERSION[0]))
versionpath = os.path.join(directory, "schemaversion.txt")
with open(versionpath, "w") as version_file:
version_file.write(str(self.VERSION[0]))
versionpath = os.path.join(directory, str(DBBACKEND)) versionpath = os.path.join(directory, str(DBBACKEND))
_LOG.debug("Write database backend file") _LOG.debug("Write database backend file")
with open(versionpath, "w") as version_file: with open(versionpath, "w") as version_file: