Skip to content

Commit b65f95f

Browse files
committed
Make sure to avoid doing DB updates avoiding sqlalchemy, as we're re-using the same session for pyfa now
1 parent 32160c9 commit b65f95f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

db_update.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ def isIgnored(file, row):
430430
attr.max = attrData['max']
431431
eos.db.gamedata_session.add(attr)
432432

433+
# Add schema version to prevent further updates
433434
metadata_schema_version = eos.gamedata.MetaData()
434435
metadata_schema_version.field_name = 'schema_version'
435436
metadata_schema_version.field_value = GAMEDATA_SCHEMA_VERSION
@@ -440,12 +441,11 @@ def isIgnored(file, row):
440441
# CCP still has 5 subsystems assigned to T3Cs, even though only 4 are available / usable. They probably have some
441442
# old legacy requirement or assumption that makes it difficult for them to change this value in the data. But for
442443
# pyfa, we can do it here as a post-processing step
443-
eos.db.gamedata_engine.execute('UPDATE dgmtypeattribs SET value = 4.0 WHERE attributeID = ?', (1367,))
444+
for attr in eos.db.gamedata_session.query(eos.gamedata.Attribute).filter(eos.gamedata.Attribute.ID == 1367).all():
445+
attr.value = 4.0
446+
for item in eos.db.gamedata_session.query(eos.gamedata.Item).filter(eos.gamedata.Item.name.like('%abyssal%')).all():
447+
item.published = False
444448

445-
eos.db.gamedata_engine.execute('UPDATE invtypes SET published = 0 WHERE typeName LIKE \'%abyssal%\'')
446-
447-
448-
print()
449449
for x in [
450450
30 # Apparel
451451
]:

0 commit comments

Comments
 (0)