I deleted 4115 templates that were not created by the admin using SQL commands. Then I deleted 4 templates with obvious test data and there were 50 templates left in the database.
Using this query I could find 30 dublicates:
SELECT template.*, count.count from template,
(SELECT count(query) count, query FROM template GROUP BY query) count
WHERE template.query=count.query ORDER BY count DESC, query;
I deleted these dublicates. Now there are 20 templates in the database with distinct queries.
I deleted 4115 templates that were not created by the admin using SQL commands. Then I deleted 4 templates with obvious test data and there were 50 templates left in the database.
Using this query I could find 30 dublicates:
I deleted these dublicates. Now there are 20 templates in the database with distinct queries.