feat: execute durable syncthing route setup
This commit is contained in:
@@ -15,6 +15,7 @@ from pathlib import Path
|
||||
|
||||
from archive_clients.config import BackupConfig
|
||||
from archive_clients.locking import DatabaseLease
|
||||
from archive_clients.state import SCHEMA_VERSION
|
||||
|
||||
|
||||
class BackupError(RuntimeError):
|
||||
@@ -183,7 +184,7 @@ class SQLiteBackupManager:
|
||||
if connection.execute("PRAGMA foreign_key_check").fetchall():
|
||||
raise BackupError("SQLite foreign-key check failed")
|
||||
version = connection.execute("PRAGMA user_version").fetchone()[0]
|
||||
if version != 1:
|
||||
if version != SCHEMA_VERSION:
|
||||
raise BackupError(f"unsupported backup schema version {version}")
|
||||
except sqlite3.Error as exc:
|
||||
raise BackupError("backup is not a readable SQLite database") from exc
|
||||
|
||||
Reference in New Issue
Block a user