[dataimport] since we have foreign key constraints in the database, 'entities' table should be updated first
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Wed, 24 Jun 2015 23:30:47 +0200
changeset 10458 9071db303c0c
parent 10457 1f5026e7d848
child 10459 5ccc3bd8927e
[dataimport] since we have foreign key constraints in the database, 'entities' table should be updated first
dataimport/__init__.py
--- a/dataimport/__init__.py	Wed Jun 24 23:23:57 2015 +0200
+++ b/dataimport/__init__.py	Wed Jun 24 23:30:47 2015 +0200
@@ -837,8 +837,8 @@
         entity.cw_edited.update(kwargs, skipsec=False)
         entity_source, extid = self.metagen.init_entity(entity)
         cnx = self._cnx
+        self.source.add_info(cnx, entity, entity_source, extid)
         self.source.add_entity(cnx, entity)
-        self.source.add_info(cnx, entity, entity_source, extid)
         kwargs = dict()
         if inspect.getargspec(self.add_relation).keywords:
             kwargs['subjtype'] = entity.cw_etype