Fixed cascade deleting
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-04-19 16:59:38 +02:00
parent e11b41f67a
commit 2c316eeebf

View File

@ -6,4 +6,4 @@ class Controller(db.Model):
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
job_id = db.Column(db.Integer, db.ForeignKey("job.id", ondelete="CASCADE"), nullable=False)
job = db.relationship("Job", backref=db.backref("controllers", lazy='joined'))
job = db.relationship("Job", cascade='delete', backref=db.backref("controllers", lazy='joined'))