(saveddata_engine)
| 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): |
no test coverage detected