add created_by to notifications

this is so one-off notifications can be tied to a user
(jobs have a created_by, and api notifications don't make sense
 to have one)
This commit is contained in:
Leo Hemsted
2017-06-13 15:33:33 +01:00
parent 8a49afc06c
commit 9f307fd1c5
4 changed files with 50 additions and 0 deletions

View File

@@ -800,6 +800,9 @@ class Notification(db.Model):
phone_prefix = db.Column(db.String, nullable=True)
rate_multiplier = db.Column(db.Float(asdecimal=False), nullable=True)
created_by = db.relationship('User')
created_by_id = db.Column(UUID(as_uuid=True), db.ForeignKey('users.id'), nullable=True)
@hybrid_property
def status(self):
return self._status_enum