diff --git a/acacore/database/files_db.py b/acacore/database/files_db.py index 37611d5..c35a194 100644 --- a/acacore/database/files_db.py +++ b/acacore/database/files_db.py @@ -17,6 +17,7 @@ from .base import FileDBBase from .base import SelectColumn from .column import model_to_columns +from .update import is_latest class HistoryEntryPath(HistoryEntry): @@ -200,6 +201,11 @@ def __init__( ], ) + if self.is_initialised(): + is_latest(self, raise_on_difference=True) + else: + self.init() + def is_initialised(self, *, check_views: bool = True, check_indices: bool = True) -> bool: tables: set[str] = {n.lower() for [n] in self.execute("select type, name from sqlite_master group by type")} if not {self.files.name.lower(), self.history.name.lower(), self.metadata.name.lower()}.issubset(set(tables)):