Skip to content

Commit

Permalink
database.upgrade:get_upgrade_function - fix incorrect order of versio…
Browse files Browse the repository at this point in the history
…n test
  • Loading branch information
MatteoCampinoti94 committed Dec 18, 2024
1 parent 2338ccf commit 938a225
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions acacore/database/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 938a225

Please sign in to comment.