From 938a225784ae0bf4727b12cc7067d806f17efd2a Mon Sep 17 00:00:00 2001 From: Matteo Campinoti Date: Wed, 18 Dec 2024 14:21:35 +0100 Subject: [PATCH] database.upgrade:get_upgrade_function - fix incorrect order of version test --- acacore/database/upgrade.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/acacore/database/upgrade.py b/acacore/database/upgrade.py index 0bde76e..e902f4f 100644 --- a/acacore/database/upgrade.py +++ b/acacore/database/upgrade.py @@ -77,10 +77,10 @@ def upgrade_4to4_1(con: Connection) -> Version: def get_upgrade_function(current_version: Version, latest_version: Version) -> Callable[[Connection], Version]: - if current_version < latest_version: - return lambda c: set_db_version(c, Version(__version__)) - elif current_version < Version("4.1.0"): + if current_version < Version("4.1.0"): return upgrade_4to4_1 + elif current_version < latest_version: + return lambda c: set_db_version(c, Version(__version__)) else: return lambda _: latest_version