Added service and template relationship to notification model.

This makes it more consistent with other model classes with respect
to marhmallow serialisation/deserialisation.
This commit is contained in:
Adam Shimali
2016-02-09 12:48:27 +00:00
parent d24a356205
commit e5e049d735
4 changed files with 15 additions and 14 deletions

View File

@@ -203,7 +203,9 @@ class Notification(db.Model):
job_id = db.Column(UUID(as_uuid=True), db.ForeignKey('jobs.id'), index=True, unique=False, nullable=False)
job = db.relationship('Job', backref=db.backref('notifications', lazy='dynamic'))
service_id = db.Column(UUID(as_uuid=True), db.ForeignKey('services.id'), index=True, unique=False)
service = db.relationship('Service')
template_id = db.Column(db.BigInteger, db.ForeignKey('templates.id'), index=True, unique=False)
template = db.relationship('Template')
created_at = db.Column(
db.DateTime,
index=False,