Update model and migration script

This commit is contained in:
Ken Tsang
2017-07-06 10:56:03 +01:00
parent f76962ad4d
commit a6df96213b
2 changed files with 30 additions and 3 deletions

View File

@@ -130,11 +130,11 @@ class BrandingTypes(db.Model):
name = db.Column(db.String(255), primary_key=True)
class Organisation(db.Model, Versioned):
class Organisation(db.Model):
__tablename__ = 'organisation'
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
colour = db.Column(db.String(7), nullable=True)
logo = db.Column(db.String(255), nullable=True)
logo = db.Column(db.String(255), nullable=False)
name = db.Column(db.String(255), nullable=True)
@classmethod
@@ -142,7 +142,7 @@ class Organisation(db.Model, Versioned):
"""
Assumption: data has been validated appropriately.
Returns a Organisation object based on the provided data.
Returns a Organisation object based on the provided data.
"""
# validate json with marshmallow
fields = data.copy()