nanterre: conserver les identifiants RSUv1
This commit is contained in:
parent
2a82e9a3e7
commit
0f70a1551f
|
@ -3,6 +3,8 @@ import sys
|
|||
|
||||
import psycopg2
|
||||
|
||||
from django import db
|
||||
|
||||
from zoo.models import Entity, Relation, EntitySchema, RelationSchema, Transaction
|
||||
from zoo.zoo_nanterre.utils import UNION_REL, RESPONSABILITE_LEGALE_REL, HABITE_REL
|
||||
|
||||
|
@ -82,7 +84,7 @@ for (individualid, gender, firstname, lastname, nameofuse, email, phones, legals
|
|||
content['telephones'] = telephones
|
||||
if email:
|
||||
content['email'] = email
|
||||
e = Entity(created=tr, schema=individu_schema, content=content)
|
||||
e = Entity(id=individualid, created=tr, schema=individu_schema, content=content)
|
||||
individu_mapping[individualid] = e
|
||||
individu_batch.append(e)
|
||||
|
||||
|
@ -93,6 +95,9 @@ for tiers_saga, individualid in cursor.fetchall():
|
|||
|
||||
Entity.objects.bulk_create(individu_batch)
|
||||
|
||||
db.connection.cursor().execute("SELECT setval(pg_get_serial_sequence('zoo_data_entity', 'id'),"
|
||||
" coalesce(max(id),0) + 1, false) FROM zoo_data_entity")
|
||||
|
||||
adresse_batch = []
|
||||
adresse_mapping = {}
|
||||
|
||||
|
|
Loading…
Reference in New Issue