From d38fdb2d113d3c356677b3fe0cfe544553b158e3 Mon Sep 17 00:00:00 2001 From: Leo Hemsted Date: Thu, 4 Aug 2016 12:35:47 +0100 Subject: [PATCH] add organisation and branding models a service now has branding and organisation_id columns, and two new tables have been aded to reflect these: * branding is a static types table referring to how a service wants their emails to be branded: * 'govuk' for GOV UK branding (default) * 'org' for organisational branding only * 'both' for co-branded output with both * organisation is a table defining an organisation's branding. this contains three entries, all of which are nullable * colour - a hex code for a coloured bar on the logo's left * logo - relative path for that org's logo image * name - the name to display on the right of the logo --- app/models.py | 2 +- migrations/versions/0046_organisations_and_branding.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models.py b/app/models.py index e3aeb3d13..2cb9b709e 100644 --- a/app/models.py +++ b/app/models.py @@ -116,7 +116,7 @@ class Service(db.Model, Versioned): secondary=user_to_service, backref=db.backref('user_to_service', lazy='dynamic')) restricted = db.Column(db.Boolean, index=False, unique=False, nullable=False) - research_mode = db.Column(db.Boolean, index=False, unique=False, nullable=True, default=False) + research_mode = db.Column(db.Boolean, index=False, unique=False, nullable=False, default=False) email_from = db.Column(db.Text, index=False, unique=True, nullable=False) created_by = db.relationship('User') created_by_id = db.Column(UUID(as_uuid=True), db.ForeignKey('users.id'), index=True, nullable=False) diff --git a/migrations/versions/0046_organisations_and_branding.py b/migrations/versions/0046_organisations_and_branding.py index c03faf2ce..fc31bdcd7 100644 --- a/migrations/versions/0046_organisations_and_branding.py +++ b/migrations/versions/0046_organisations_and_branding.py @@ -33,6 +33,7 @@ def upgrade(): op.add_column('services_history', sa.Column('organisation_id', postgresql.UUID(as_uuid=True))) op.execute("INSERT INTO branding_type VALUES ('govuk'), ('org'), ('both')") + # insert UKVI data as initial test data. hex and crest pulled from alphagov/whitehall op.execute("""INSERT INTO organisation VALUES ( '9d25d02d-2915-4e98-874b-974e123e8536',