Skip to content

Commit

Permalink
changing relationships to cascade for evaluation, execution and submi…
Browse files Browse the repository at this point in the history
…ssion with task relations*
  • Loading branch information
ooemperor committed Mar 25, 2024
1 parent 65d5ffd commit e0cdce4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion codeGrader/backend/db/EvaluationResult.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class EvaluationResult(Base):
# Foreign Keys
submission_id = Column(
Integer,
ForeignKey(Submission.id, onupdate="CASCADE", ondelete="SET NULL"),
ForeignKey(Submission.id, onupdate="CASCADE", ondelete="CASCADE"),
nullable=True,
index=True
)
Expand Down
2 changes: 1 addition & 1 deletion codeGrader/backend/db/ExecutionResult.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ExecutionResult(Base):
# Foreign Keys
submission_id = Column(
Integer,
ForeignKey(Submission.id, onupdate="CASCADE", ondelete="SET NULL"),
ForeignKey(Submission.id, onupdate="CASCADE", ondelete="CASCADE"),
nullable=True,
index=True
)
Expand Down
4 changes: 2 additions & 2 deletions codeGrader/backend/db/Submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ class Submission(Base):

user_id = Column(
Integer,
ForeignKey(User.id, onupdate="CASCADE", ondelete="SET NULL"),
ForeignKey(User.id, onupdate="CASCADE", ondelete="CASCADE"),
nullable=False,
index=True
)

task_id = Column(
Integer,
ForeignKey(Task.id, onupdate="CASCADE", ondelete="SET NULL"),
ForeignKey(Task.id, onupdate="CASCADE", ondelete="CASCADE"),
nullable=False,
index=True
)
Expand Down

0 comments on commit e0cdce4

Please sign in to comment.