From 73cba00b0915ac0ccf641354fd1850bcdcc29011 Mon Sep 17 00:00:00 2001
From: Ruben Young On <r.d.youngon@student.tudelft.nl>
Date: Sat, 18 May 2019 14:29:09 +0200
Subject: [PATCH] Added relationship between mc_option and feedbackoption,
 problem_id is no longer used

---
 zesje/database.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zesje/database.py b/zesje/database.py
index ed8bdced..16f53b27 100644
--- a/zesje/database.py
+++ b/zesje/database.py
@@ -110,6 +110,7 @@ class FeedbackOption(db.Model):
     text = Column(Text, nullable=False)
     description = Column(Text, nullable=True)
     score = Column(Integer, nullable=True)
+    mc_option = db.relationship('MultipleChoiceOption', backref='feedback', lazy=True)
 
 
 # Table for many to many relationship of FeedbackOption and Solution
@@ -166,7 +167,6 @@ class MultipleChoiceOption(Widget):
     id = Column(Integer, ForeignKey('widget.id'), primary_key=True, autoincrement=True)
 
     label = Column(String, nullable=True)
-    problem_id = Column(Integer, ForeignKey('problem.id'), nullable=False)
     feedback_id = Column(Integer, ForeignKey('feedback_option.id'), nullable=False)
 
     __mapper_args__ = {
-- 
GitLab