From 858b101a36102702afcf29d405d39a0bd5a770fe Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Sat, 24 Jun 2023 13:14:40 -0400 Subject: [PATCH] dbutils: add command to show versions --- core/data/database.py | 5 +++++ dbutils.py | 3 +++ 2 files changed, 8 insertions(+) diff --git a/core/data/database.py b/core/data/database.py index 719d05e..ffbefc0 100644 --- a/core/data/database.py +++ b/core/data/database.py @@ -333,3 +333,8 @@ class Data: if not failed: self.base.set_schema_ver(latest_ver, game) + + def show_versions(self) -> None: + all_game_versions = self.base.get_all_schema_vers() + for ver in all_game_versions: + self.logger.info(f"{ver['game']} -> v{ver['version']}") diff --git a/dbutils.py b/dbutils.py index d959232..caae9d8 100644 --- a/dbutils.py +++ b/dbutils.py @@ -84,5 +84,8 @@ if __name__ == "__main__": elif args.action == "cleanup": data.delete_hanging_users() + + elif args.action == "version": + data.show_versions() data.logger.info("Done")