New table to hold scheduled_notifications.

This commit is contained in:
Rebecca Law
2017-05-15 12:59:44 +01:00
parent cd85550889
commit 75a4dad8c1
2 changed files with 41 additions and 0 deletions

View File

@@ -912,6 +912,16 @@ class NotificationHistory(db.Model, HistoryModel):
INVITED_USER_STATUS_TYPES = ['pending', 'accepted', 'cancelled']
class ScheduledNotification(db.Model):
__tablename__ = 'scheduled_notifications'
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4())
notification_id = db.Column(UUID(as_uuid=True), db.ForeignKey('notifications.id'), index=True, nullable=False)
notification = db.relationship('Notification')
scheduled_for = db.Column(db.DateTime, index=False, nullable=False)
pending = db.Column(db.Boolean, nullable=False, default=False)
class InvitedUser(db.Model):
__tablename__ = 'invited_users'