FAIMS-410: checking if template_db already exists and deleting on generate