nanterre: deduplicate union relationships in load-dump

This commit is contained in:
Benjamin Dauvergne 2017-04-04 14:09:53 +02:00
parent 73bc2624e0
commit 6fd78867c8
1 changed files with 6 additions and 0 deletions

View File

@ -167,8 +167,14 @@ FROM individualrelation''')
relation_batch = []
seen = set()
for label, relationtype, responsibleid, subjectid in cursor.fetchall():
if relationtype == 'SituationFamiliale':
key = (min(responsibleid, subjectid), max(responsibleid, subjectid))
if key in seen:
continue
seen.add(key)
schema = union_schema
if label == 'Marie':
kind = 'mariage'