forked from ScoDoc/ScoDoc
Fix migration script
This commit is contained in:
parent
b5b606b1f6
commit
74f81ce6d2
@ -38,8 +38,8 @@ def upgrade():
|
|||||||
for dept_id, code_nip in dups:
|
for dept_id, code_nip in dups:
|
||||||
etuds_dups = session.execute(
|
etuds_dups = session.execute(
|
||||||
"""SELECT id, nom, prenom FROM identite
|
"""SELECT id, nom, prenom FROM identite
|
||||||
WHERE code_nip=:code_nip""",
|
WHERE dept_id=:dept_id AND code_nip=:code_nip""",
|
||||||
{"code_nip": code_nip},
|
{"dept_id": dept_id, "code_nip": code_nip},
|
||||||
).all()
|
).all()
|
||||||
for i, (etudid, nom, prenom) in enumerate(etuds_dups[1:], start=1):
|
for i, (etudid, nom, prenom) in enumerate(etuds_dups[1:], start=1):
|
||||||
session.execute(
|
session.execute(
|
||||||
@ -64,8 +64,8 @@ def upgrade():
|
|||||||
for dept_id, code_ine in dups:
|
for dept_id, code_ine in dups:
|
||||||
etuds_dups = session.execute(
|
etuds_dups = session.execute(
|
||||||
"""SELECT id, nom, prenom FROM identite
|
"""SELECT id, nom, prenom FROM identite
|
||||||
WHERE code_ine=:code_ine""",
|
WHERE dept_id=:dept_id AND code_ine=:code_ine""",
|
||||||
{"code_ine": code_ine},
|
{"dept_id": dept_id, "code_ine": code_ine},
|
||||||
).all()
|
).all()
|
||||||
for i, (etudid, nom, prenom) in enumerate(etuds_dups[1:], start=1):
|
for i, (etudid, nom, prenom) in enumerate(etuds_dups[1:], start=1):
|
||||||
session.execute(
|
session.execute(
|
||||||
|
Loading…
Reference in New Issue
Block a user