Added constraints to services.postage: not nullable and can only containt "first" or "second"

This commit is contained in:
Rebecca Law
2018-09-18 17:41:25 +01:00
parent 29a666302e
commit 5f73dfdbe9
4 changed files with 48 additions and 13 deletions

View File

@@ -353,7 +353,9 @@ class Service(db.Model, Versioned):
crown = db.Column(db.Boolean, index=False, nullable=False, default=True)
rate_limit = db.Column(db.Integer, index=False, nullable=False, default=3000)
contact_link = db.Column(db.String(255), nullable=True, unique=False)
postage = db.Column(db.String(255), index=False, nullable=True)
postage = db.Column(db.String(255), index=False, nullable=False, default='second')
CheckConstraint("'postage' in ('first', 'second')")
organisation = db.relationship(
'Organisation',