Add missing migration

This commit is contained in:
Mathieu Comandon 2020-09-24 01:39:31 -07:00 committed by Mathieu Comandon
parent 8f36687a2c
commit 3ed5e204ac

View file

@ -0,0 +1,18 @@
"""Set service ID for Steam games"""
from lutris.database.games import PGA_DB, get_games, sql
def migrate():
"""Run migration"""
for game in get_games():
if not game["steamid"]:
continue
if game["runner"] and game["runner"] != "steam":
continue
print("Migrating Steam game %s" % game["name"])
sql.db_update(
PGA_DB,
"games",
{"service": "steam", "service_id": game["steamid"]},
{"id": game["id"]}
)