Files
pyfa/eos/db/migration.py
DarkPhoenix fd36a0b172 Replace submodules with actual files
Submodules never were actually useful
2013-06-10 22:12:34 +04:00

21 lines
684 B
Python
Executable File

import sqlalchemy
def update(saveddata_engine):
checkPriceFailures(saveddata_engine)
def checkPriceFailures(saveddata_engine):
# Check if we have 'failed' column
try:
saveddata_engine.execute("SELECT failed FROM prices")
except sqlalchemy.exc.DatabaseError:
# As we don't have any important data there, let's just drop
# and recreate whole table
from eos.db.saveddata.price import prices_table
# Attempt to drop/create table only if it's already there
try:
prices_table.drop(saveddata_engine)
prices_table.create(saveddata_engine)
except sqlalchemy.exc.DatabaseError:
pass