Files
pyfa/eos/db/migrations/upgrade19.py
2017-02-08 14:22:56 -08:00

19 lines
408 B
Python

"""
Migration 19
- Deletes broken references to fits from the commandFits table (see GH issue #844)
"""
def upgrade(saveddata_engine):
from eos.db import saveddata_session
sql = """
DELETE FROM commandFits
WHERE boosterID NOT IN (select ID from fits)
OR boostedID NOT IN (select ID from fits)
"""
saveddata_session.execute(sql)
saveddata_session.commit()