From 6c84ad84d30f1ccb7078bb9295aea62f050e7833 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Herv=C3=A9=20=20MENAGER?= <herve.menager@pasteur.fr>
Date: Thu, 23 Mar 2017 21:40:29 +0100
Subject: [PATCH] clear Taxonomy table before to open proteins

---
 ippisite/ippidb/management/commands/import_v1_data.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ippisite/ippidb/management/commands/import_v1_data.py b/ippisite/ippidb/management/commands/import_v1_data.py
index 22a073ef..aa2e6623 100644
--- a/ippisite/ippidb/management/commands/import_v1_data.py
+++ b/ippisite/ippidb/management/commands/import_v1_data.py
@@ -1,6 +1,7 @@
 from django.core.management import BaseCommand
 import mysql.connector
-from ippidb.models import Bibliography, Protein
+
+from ippidb.models import Bibliography, Protein, Taxonomy
 
 class Command(BaseCommand):
 
@@ -48,6 +49,7 @@ class Command(BaseCommand):
             rows = cursor.fetchall()
             Protein.objects.all().delete()
             self.stdout.write(self.style.SUCCESS('Successfully flushed protein table'))
+            Taxonomy.objects.all().delete()
             for row in rows:
                 try:
                     p = Protein()
-- 
GitLab