diff --git a/eos/db/migrations/upgrade17.py b/eos/db/migrations/upgrade17.py index 90ed6e646..0ea746355 100644 --- a/eos/db/migrations/upgrade17.py +++ b/eos/db/migrations/upgrade17.py @@ -16,23 +16,27 @@ def upgrade(saveddata_engine): JOIN wings w on w.ID = s.wingID JOIN gangs g on g.ID = w.gangID """ + try: + results = saveddata_session.execute(sql) - results = saveddata_session.execute(sql) + inserts = [] - inserts = [] + for row in results: + boosted = row["boostedFit"] + types = ("squad", "wing", "gang") + for x in types: + value = row["{}Boost".format(x)] + if value is None: + continue - for row in results: - boosted = row["boostedFit"] - types = ("squad", "wing", "gang") - for x in types: - value = row["{}Boost".format(x)] - if value is None: - continue - - inserts.append({"boosterID": value, "boostedID": boosted, "active": 1}) - try: - saveddata_session.execute(commandFits_table.insert(), - {"boosterID": value, "boostedID": boosted, "active": 1}) - except Exception: - pass - saveddata_session.commit() + inserts.append({"boosterID": value, "boostedID": boosted, "active": 1}) + try: + saveddata_session.execute(commandFits_table.insert(), + {"boosterID": value, "boostedID": boosted, "active": 1}) + except Exception: + pass + saveddata_session.commit() + except: + # Shouldn't fail unless you have updated database without the old fleet schema and manually modify the database version + # If it does, simply fail. Fleet data migration isn't critically important here + pass diff --git a/eos/db/migrations/upgrade6.py b/eos/db/migrations/upgrade6.py index 724a94008..a6d0a5191 100644 --- a/eos/db/migrations/upgrade6.py +++ b/eos/db/migrations/upgrade6.py @@ -7,5 +7,5 @@ Overwrites damage profile 0 to reset bad uniform values (bad values set with bug def upgrade(saveddata_engine): saveddata_engine.execute('DELETE FROM damagePatterns WHERE name LIKE ? OR ID LIKE ?', ("Uniform", "1")) - saveddata_engine.execute('INSERT INTO damagePatterns VALUES (?, ?, ?, ?, ?, ?, ?)', - (1, "Uniform", 25, 25, 25, 25, None)) + saveddata_engine.execute('INSERT INTO damagePatterns VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)', + (1, "Uniform", 25, 25, 25, 25, None, None, None))