[dataimport] simplify SQLGenSourceWrapper.add_info
At this point 'CWSource' is a thing (we're not in the middle of a
migration), and source.eid won't be None (we read it from the db)
--- a/dataimport/pgstore.py Mon Feb 01 15:10:35 2016 +0100
+++ b/dataimport/pgstore.py Fri Jan 29 10:06:36 2016 +0100
@@ -436,9 +436,8 @@
self._handle_is_relation_sql(cnx,
'INSERT INTO is_instance_of_relation(eid_from,eid_to) VALUES (%s,%s)',
(entity.eid, eschema_eid(cnx, eschema)))
- if 'CWSource' in self.schema and source.eid is not None: # else, cw < 3.10
- self._handle_is_relation_sql(cnx, 'INSERT INTO cw_source_relation(eid_from,eid_to) VALUES (%s,%s)',
- (entity.eid, source.eid))
+ self._handle_is_relation_sql(cnx, 'INSERT INTO cw_source_relation(eid_from,eid_to) VALUES (%s,%s)',
+ (entity.eid, source.eid))
# now we can update the full text index
if self.do_fti and self.need_fti_indexation(entity.cw_etype):
self.index_entity(cnx, entity=entity)