forked from ScoDoc/ScoDoc
Update opolka/ScoDoc from ScoDoc/ScoDoc #2
@ -77,19 +77,17 @@ def upgrade():
|
||||
["id"],
|
||||
)
|
||||
# Efface les validations d'année dupliquées
|
||||
# (garde le premier code dans l'ordre alphabétique... mieux que rien)
|
||||
# (garde la validation la plus récente)
|
||||
session.execute(
|
||||
sa.text(
|
||||
"""
|
||||
DELETE FROM apc_validation_annee t1
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM apc_validation_annee t2
|
||||
WHERE t1.etudid = t2.etudid
|
||||
WHERE t1.id <> (SELECT max(t2.id)
|
||||
FROM apc_validation_annee t2
|
||||
WHERE t1.etudid = t2.etudid
|
||||
AND t1.referentiel_competence_id = t2.referentiel_competence_id
|
||||
AND t1.ordre = t2.ordre
|
||||
AND t1.code > t2.code
|
||||
);
|
||||
)
|
||||
"""
|
||||
)
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user