Skip to content

Commit

Permalink
Those who keep up with dev branch had issues with new migrations.
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzmann committed Sep 30, 2014
1 parent b69a46f commit 1bdfd7f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eos/db/migrations/upgrade1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
and output of itemDiff.py
"""

import sqlalchemy

CONVERSIONS = {
6135: [ # Scoped Cargo Scanner
6133, # Interior Type-E Cargo Identifier
Expand Down Expand Up @@ -82,7 +84,10 @@

def upgrade(saveddata_engine):
# Update fits schema
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN targetResistsID INTEGER;")
try:
saveddata_engine.execute("SELECT targetResistsID FROM fits LIMIT 1")
except sqlalchemy.exc.DatabaseError:
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN targetResistsID INTEGER;")

# Convert modules
for replacement_item, list in CONVERSIONS.iteritems():
Expand Down

0 comments on commit 1bdfd7f

Please sign in to comment.