From 97b3322e51f6fe850bd941f34c7b34604f36315c Mon Sep 17 00:00:00 2001 From: ilona Date: Fri, 23 Aug 2024 06:30:12 +0200 Subject: [PATCH] Ajout champs confidential sur EtudAnnotation --- app/models/etudiants.py | 1 + migrations/versions/2640b7686de6_formsemestre_description.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/app/models/etudiants.py b/app/models/etudiants.py index e64bbbb8..ff307194 100644 --- a/app/models/etudiants.py +++ b/app/models/etudiants.py @@ -1127,6 +1127,7 @@ class EtudAnnotation(models.ScoDocModel): etudid = db.Column(db.Integer, db.ForeignKey(Identite.id)) author = db.Column(db.Text) # le pseudo (user_name), was zope_authenticated_user comment = db.Column(db.Text) + confidential = db.Column(db.Boolean, default=False) _sco_dept_relations = ("Identite",) # accès au dept_id diff --git a/migrations/versions/2640b7686de6_formsemestre_description.py b/migrations/versions/2640b7686de6_formsemestre_description.py index c2533093..d05c21ec 100644 --- a/migrations/versions/2640b7686de6_formsemestre_description.py +++ b/migrations/versions/2640b7686de6_formsemestre_description.py @@ -43,9 +43,14 @@ def upgrade(): ) with op.batch_alter_table("notes_formsemestre", schema=None) as batch_op: batch_op.add_column(sa.Column("capacite_accueil", sa.Integer(), nullable=True)) + # Annotations confidentielles + with op.batch_alter_table("etud_annotations", schema=None) as batch_op: + batch_op.add_column(sa.Column("confidential", sa.Boolean(), nullable=True)) def downgrade(): with op.batch_alter_table("notes_formsemestre", schema=None) as batch_op: batch_op.drop_column("capacite_accueil") op.drop_table("notes_formsemestre_description") + with op.batch_alter_table("etud_annotations", schema=None) as batch_op: + batch_op.drop_column("confidential")