Add extra columns to target profile table

This commit is contained in:
DarkPhoenix
2019-07-24 19:50:58 +03:00
parent a652e12fa4
commit 072ad028a3

View File

@@ -0,0 +1,16 @@
"""
Migration 32
- added speed, sig and radius columns to targetResists table
"""
import sqlalchemy
def upgrade(saveddata_engine):
for column in ('maxVelocity', 'signatureRadius', 'radius'):
try:
saveddata_engine.execute("SELECT {} FROM targetResists LIMIT 1;".format(column))
except sqlalchemy.exc.DatabaseError:
saveddata_engine.execute("ALTER TABLE targetResists ADD COLUMN {} FLOAT;".format(column))