1
0
forked from Hay1tsme/artemis

database: fix error when trying to upgrade the schema for a game that wasn't created yet

This commit is contained in:
Hay1tsme 2023-03-03 19:23:14 -05:00
parent 02e1838d95
commit 4f3d3d8395

View File

@ -85,7 +85,12 @@ class BaseData():
result = self.execute(sql) result = self.execute(sql)
if result is None: if result is None:
return None return None
return result.fetchone()["version"]
row = result.fetchone()
if row is None:
return None
return row["version"]
def set_schema_ver(self, ver: int, game: str = "CORE") -> Optional[int]: def set_schema_ver(self, ver: int, game: str = "CORE") -> Optional[int]:
sql = insert(schema_ver).values(game = game, version = ver) sql = insert(schema_ver).values(game = game, version = ver)