From 3777358287dd4f2ec485d7d53c29d83bf6f56974 Mon Sep 17 00:00:00 2001 From: Pea Tyczynska Date: Tue, 12 Apr 2022 18:28:55 +0100 Subject: [PATCH] Move existing nhs orgs without branding onto nhs branding This is done to make self-service branding easier to implement, and also because NHS branding makes much more sense for services in those orgs than GOV.UK branding. --- .../0368_move_orgs_to_nhs_branding_.py | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 migrations/versions/0368_move_orgs_to_nhs_branding_.py diff --git a/migrations/versions/0368_move_orgs_to_nhs_branding_.py b/migrations/versions/0368_move_orgs_to_nhs_branding_.py new file mode 100644 index 000000000..abc060ad2 --- /dev/null +++ b/migrations/versions/0368_move_orgs_to_nhs_branding_.py @@ -0,0 +1,32 @@ +""" + +Revision ID: 0368_move_orgs_to_nhs_branding +Revises: 0367_add_reach +Create Date: 2022-04-12 18:22:12.069016 + +""" +from alembic import op + +revision = '0368_move_orgs_to_nhs_branding' +down_revision = '0367_add_reach' + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.execute(""" + UPDATE + organisation + SET + email_branding_id = 'a7dc4e56-660b-4db7-8cff-12c37b12b5ea' + WHERE + organisation_type IN ('nhs_central', 'nhs_local', 'nhs_gp') + AND + email_branding_id IS NULL + """) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ###