Remove govuk from possible brands

‘GOV.UK’ doesn’t make sense as a type of brand. It only made sense as
a type of branding that a service had.

Since we’ve:
- deprecated the service branding column
- made sure it’s not used as a value in the email branding table

we can remove this value from the table of possible brand types.
This commit is contained in:
Chris Hill-Scott
2018-08-30 16:22:59 +01:00
parent 337496c5bc
commit 0c47d41977
5 changed files with 35 additions and 23 deletions

View File

@@ -4,6 +4,7 @@ Revises: 0220_email_brand_type_non_null
Create Date: 2018-08-24 13:36:49.346156
"""
from alembic import op
from app.models import BRANDING_ORG, BRANDING_GOVUK
revision = '0221_nullable_service_branding'
@@ -20,6 +21,22 @@ def upgrade():
op.alter_column('services_history', 'branding', nullable=True)
op.alter_column('services', 'branding', nullable=True)
op.execute("""
update
email_branding
set
brand_type = '{}'
where
brand_type = '{}'
""".format(BRANDING_ORG, BRANDING_GOVUK))
op.execute("""
delete from
branding_type
where
name = '{}'
""".format(BRANDING_GOVUK))
def downgrade():
@@ -30,3 +47,11 @@ def downgrade():
op.alter_column('services', 'branding', nullable=False)
op.alter_column('services_history', 'branding', nullable=False)
op.execute("""
insert into
branding_type
(name)
values
('{}')
""".format(BRANDING_GOVUK))