MCPcopy Create free account
hub / github.com/pyfa-org/Pyfa / upgrade

Function upgrade

eos/db/migrations/upgrade14.py:10–21  ·  view source on GitHub ↗
(saveddata_engine)

Source from the content-addressed store, hash-verified

8
9
10def upgrade(saveddata_engine):
11 if saveddata_engine.execute(
12 "SELECT name FROM sqlite_master WHERE type='table' AND name='fighters'").scalar() == 'fighters':
13 # Fighters table exists
14 try:
15 saveddata_engine.execute("SELECT active FROM fighters LIMIT 1")
16 except sqlalchemy.exc.DatabaseError:
17 # if we don't have the active column, we are on an old pre-release version. Drop the tables and move on
18 # (they will be recreated)
19
20 saveddata_engine.execute("DROP TABLE fighters")
21 saveddata_engine.execute("DROP TABLE fightersAbilities")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected