(saveddata_engine)
| 125 | |
| 126 | @staticmethod |
| 127 | def NullDamagePatternNames(saveddata_engine): |
| 128 | # Find damage patterns that are missing the name. |
| 129 | # This solves an issue where the damage pattern ends up with a name that is null. |
| 130 | # See issue #949 |
| 131 | pyfalog.debug("Running database cleanup for missing damage pattern names.") |
| 132 | query = "SELECT COUNT(*) AS num FROM damagePatterns WHERE name IS NULL OR name = ''" |
| 133 | results = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query) |
| 134 | |
| 135 | if results is None: |
| 136 | return |
| 137 | |
| 138 | row = results.first() |
| 139 | |
| 140 | if row and row['num']: |
| 141 | query = "DELETE FROM damagePatterns WHERE name IS NULL OR name = ''" |
| 142 | delete = DatabaseCleanup.ExecuteSQLQuery(saveddata_engine, query) |
| 143 | pyfalog.error("Database corruption found. Cleaning up {0} records.", delete.rowcount) |
| 144 | |
| 145 | @staticmethod |
| 146 | def NullTargetResistNames(saveddata_engine): |
no test coverage detected