From aaba157587a338727f71b9b6fbed4b902029931f Mon Sep 17 00:00:00 2001 From: Richard Chapman Date: Thu, 31 May 2018 15:13:31 +0100 Subject: [PATCH] Added Service contact_link column This is going to be used for for the document download citizen landing page, a service will add a contact link e.g. https://customerservicecontactnumber.uk/dwp/ which will allow the user to contact the sending department if there is an error or any issues with the download. * Added the contact link to the model * Added db migration script to add the column to the database --- app/models.py | 1 + .../versions/0196_service_contact_link.py | 23 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 migrations/versions/0196_service_contact_link.py diff --git a/app/models.py b/app/models.py index b8e65b891..4d1802582 100644 --- a/app/models.py +++ b/app/models.py @@ -342,6 +342,7 @@ 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) organisation = db.relationship( 'Organisation', diff --git a/migrations/versions/0196_service_contact_link.py b/migrations/versions/0196_service_contact_link.py new file mode 100644 index 000000000..255612b10 --- /dev/null +++ b/migrations/versions/0196_service_contact_link.py @@ -0,0 +1,23 @@ +""" + +Revision ID: 0196_service_contact_link +Revises: 0195_ft_notification_timestamps +Create Date: 2018-05-31 15:01:32.977620 + +""" +from alembic import op +import sqlalchemy as sa + + +revision = '0196_service_contact_link' +down_revision = '0195_ft_notification_timestamps' + + +def upgrade(): + op.add_column('services', sa.Column('contact_link', sa.String(length=255), nullable=True)) + op.add_column('services_history', sa.Column('contact_link', sa.String(length=255), nullable=True)) + + +def downgrade(): + op.drop_column('services_history', 'contact_link') + op.drop_column('services', 'contact_link')