make notification.key_type not nullable

set to 'normal' for all existing notifications, and all job notifications also created as 'normal' - so if your eg reporting service hits notify, it gets notifications created from both API calls and front-end csv jobs.
This commit is contained in:
Leo Hemsted
2016-07-01 16:30:45 +01:00
parent 2cf1d22748
commit f992240192
3 changed files with 32 additions and 3 deletions

View File

@@ -349,7 +349,7 @@ class Notification(db.Model):
template_version = db.Column(db.Integer, nullable=False)
api_key_id = db.Column(UUID(as_uuid=True), db.ForeignKey('api_keys.id'), index=True, unique=False)
api_key = db.relationship('ApiKey')
key_type = db.Column(db.String, db.ForeignKey('key_types.name'), index=True, unique=False)
key_type = db.Column(db.String, db.ForeignKey('key_types.name'), index=True, unique=False, nullable=False)
content_char_count = db.Column(db.Integer, nullable=True)
notification_type = db.Column(notification_types, nullable=False)
created_at = db.Column(