MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / NullTargetResistNames

Method NullTargetResistNames

eos/db/saveddata/databaseRepair.py:146–162  ·  view source on GitHub ↗
(saveddata_engine)

Source from the content-addressed store, hash-verified

144
145 @staticmethod
146 def NullTargetResistNames(saveddata_engine):
147 # Find target resists that are missing the name.
148 # This solves an issue where the target resist ends up with a name that is null.
149 # See issue #949
150 pyfalog.debug("Running database cleanup for missing target resist names.")
151 query = "SELECT COUNT(*) AS num FROM targetResists WHERE name IS NULL OR name = ''"
152 results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
153
154 if results is None:
155 return
156
157 row = results.first()
158
159 if row and row['num']:
160 query = "DELETE FROM targetResists WHERE name IS NULL OR name = ''"
161 delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query)
162 pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount)
163
164 @staticmethod
165 def OrphanedFitIDItemID(saveddata_engine):

Callers 1

prefetch.pyFile · 0.80

Calls 1

ExecuteSQLQueryMethod · 0.80

Tested by

no test coverage detected