X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/cf98cff2a166eb35ed2c946e03f1610069bdd1d4..925195725dfcb7f1a6795c50244c1df6cb7242ce:/nominatim/tools/special_phrases/sp_importer.py diff --git a/nominatim/tools/special_phrases/sp_importer.py b/nominatim/tools/special_phrases/sp_importer.py index a26ea8a6..791f4dc3 100644 --- a/nominatim/tools/special_phrases/sp_importer.py +++ b/nominatim/tools/special_phrases/sp_importer.py @@ -248,20 +248,14 @@ class SPImporter(): Delete the place_classtype tables. """ LOG.warning('Cleaning database...') - # Array containing all queries to execute. - # Contains tuples of format (query, parameters) - queries_parameters = [] # Delete place_classtype tables corresponding to class/type which # are not on the wiki anymore. - for table in self.table_phrases_to_delete: - self.statistics_handler.notify_one_table_deleted() - query = SQL('DROP TABLE IF EXISTS {}').format(Identifier(table)) - queries_parameters.append((query, ())) - with self.db_connection.cursor() as db_cursor: - for query, parameters in queries_parameters: - db_cursor.execute(query, parameters) + for table in self.table_phrases_to_delete: + self.statistics_handler.notify_one_table_deleted() + db_cursor.drop_table(table) + def _convert_php_settings_if_needed(self, file_path): """