mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
Add cascade deletion of jobs and corpora on user delete.
This commit is contained in:
parent
bccf661957
commit
388efbbd73
@ -113,8 +113,10 @@ class User(UserMixin, db.Model):
|
||||
role_id = db.Column(db.Integer, db.ForeignKey('roles.id'))
|
||||
username = db.Column(db.String(64), unique=True, index=True)
|
||||
# Relationships
|
||||
corpora = db.relationship('Corpus', backref='creator', lazy='dynamic')
|
||||
jobs = db.relationship('Job', backref='creator', lazy='dynamic')
|
||||
corpora = db.relationship('Corpus', backref='creator', lazy='dynamic',
|
||||
cascade='save-update, merge, delete')
|
||||
jobs = db.relationship('Job', backref='creator', lazy='dynamic',
|
||||
cascade='save-update, merge, delete')
|
||||
|
||||
def __repr__(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user