1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-12-20 23:41:20 +00:00

Fix max mark constraint

This commit is contained in:
Mo 2022-04-12 01:47:37 +02:00
parent 0ee5fcd52b
commit e891fe4050

View file

@ -501,20 +501,20 @@ class ExperimentMark(db.Model):
oral_mark = db.Column(
db.Integer,
db.CheckConstraint(f"oral_mark >= {MIN_MARK}"),
db.CheckConstraint(f"oral_mark <= {MIN_MARK}"),
db.CheckConstraint(f"oral_mark <= {MAX_MARK}"),
nullable=True,
)
protocol_mark = db.Column(
db.Integer,
db.CheckConstraint(f"oral_mark >= {MIN_MARK}"),
db.CheckConstraint(f"oral_mark <= {MIN_MARK}"),
db.CheckConstraint(f"oral_mark <= {MAX_MARK}"),
nullable=True,
)
final_experiment_mark = db.Column(
db.Integer,
db.CheckConstraint(f"oral_mark >= {MIN_MARK}"),
db.CheckConstraint(f"oral_mark <= {MIN_MARK}"),
db.CheckConstraint(f"oral_mark <= {MAX_MARK}"),
onupdate=final_experiment_mark_update,
nullable=True,
)