Adds a new notes pane for each fit
This allows users to save text notes for each fit. They may do this for history, or usage, etc.
This commit is contained in:
14
eos/db/migrations/upgrade16.py
Normal file
14
eos/db/migrations/upgrade16.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
Migration 16
|
||||
|
||||
- Alters fits table to introduce notes attribute
|
||||
"""
|
||||
|
||||
import sqlalchemy
|
||||
|
||||
def upgrade(saveddata_engine):
|
||||
# Update fits schema to include notes attribute
|
||||
try:
|
||||
saveddata_engine.execute("SELECT notes FROM fits LIMIT 1")
|
||||
except sqlalchemy.exc.DatabaseError:
|
||||
saveddata_engine.execute("ALTER TABLE fits ADD COLUMN notes VARCHAR;")
|
||||
@@ -45,6 +45,7 @@ fits_table = Table("fits", saveddata_meta,
|
||||
Column("targetResistsID", ForeignKey("targetResists.ID"), nullable=True),
|
||||
Column("modeID", Integer, nullable=True),
|
||||
Column("implantLocation", Integer, nullable=False, default=ImplantLocation.FIT),
|
||||
Column("notes", String, nullable = True),
|
||||
)
|
||||
|
||||
projectedFits_table = Table("projectedFits", saveddata_meta,
|
||||
|
||||
@@ -1085,6 +1085,7 @@ class Fit(object):
|
||||
copy.name = "%s copy" % self.name
|
||||
copy.damagePattern = self.damagePattern
|
||||
copy.targetResists = self.targetResists
|
||||
copy.notes = self.notes
|
||||
|
||||
toCopy = (
|
||||
"modules",
|
||||
|
||||
Reference in New Issue
Block a user