File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121
2222# Database version (int ONLY)
2323# Increment every time we need to flag for user database upgrade/modification
24- dbversion = 1
24+ dbversion = 2
2525
2626pyfaPath = None
2727savePath = None
Original file line number Diff line number Diff line change 11"""
22Migration 1
33
4- - Includes old upgrade paths pre-1.5.0
54- Alters fits table to introduce target resist attribute
65- Converts modules based on Oceanus Module Tiericide
76 Some modules have been deleted, which causes pyfa to crash when fits are
8483}
8584
8685def upgrade (saveddata_engine ):
87-
88- # Update characters schema to include default chars (pre-1.5.0 migration)
89- try :
90- saveddata_engine .execute ("SELECT defaultChar, chars FROM characters LIMIT 1" )
91- except sqlalchemy .exc .DatabaseError :
92- saveddata_engine .execute ("ALTER TABLE characters ADD COLUMN defaultChar INTEGER;" )
93- saveddata_engine .execute ("ALTER TABLE characters ADD COLUMN chars VARCHAR;" )
94-
95- # Update fits schema to include booster attribute (pre-1.5.0 migration)
96- try :
97- saveddata_engine .execute ("SELECT booster FROM fits LIMIT 1" )
98- except sqlalchemy .exc .DatabaseError :
99- saveddata_engine .execute ("ALTER TABLE fits ADD COLUMN booster BOOLEAN;" )
100-
10186 # Update fits schema to include target resists attribute
10287 try :
10388 saveddata_engine .execute ("SELECT targetResistsID FROM fits LIMIT 1" )
Original file line number Diff line number Diff line change 1+ """
2+ Migration 2
3+
4+ - Includes old upgrade paths pre-1.5.0. See GH issue #190 for why this is needed
5+ """
6+
7+ import sqlalchemy
8+
9+ def upgrade (saveddata_engine ):
10+ # Update characters schema to include default chars
11+ try :
12+ saveddata_engine .execute ("SELECT defaultChar, chars FROM characters LIMIT 1" )
13+ except sqlalchemy .exc .DatabaseError :
14+ saveddata_engine .execute ("ALTER TABLE characters ADD COLUMN defaultChar INTEGER" )
15+ saveddata_engine .execute ("ALTER TABLE characters ADD COLUMN chars VARCHAR" )
16+
17+ # Update fits schema to include booster attribute
18+ try :
19+ saveddata_engine .execute ("SELECT booster FROM fits LIMIT 1" )
20+ except sqlalchemy .exc .DatabaseError :
21+ saveddata_engine .execute ("ALTER TABLE fits ADD COLUMN booster BOOLEAN" )
You can’t perform that action at this time.
0 commit comments