From 8f9ee7f7ad751a3d785e1063c7bbf52b4c8a8de2 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Fri, 12 Oct 2018 10:36:41 +0100 Subject: [PATCH] Add letter org for Brighton and Hove --- .../versions/0236_another_letter_org.py | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 migrations/versions/0236_another_letter_org.py diff --git a/migrations/versions/0236_another_letter_org.py b/migrations/versions/0236_another_letter_org.py new file mode 100644 index 000000000..c49b8fd46 --- /dev/null +++ b/migrations/versions/0236_another_letter_org.py @@ -0,0 +1,35 @@ +"""empty message + +Revision ID: 0236_another_letter_org +Revises: 0235_add_postage_to_pk + +""" + +# revision identifiers, used by Alembic. +revision = '0236_another_letter_org' +down_revision = '0235_add_postage_to_pk' + +from alembic import op + + +NEW_ORGANISATIONS = [ + ('514', 'Brighton and Hove city council'), +] + + +def upgrade(): + for numeric_id, name in NEW_ORGANISATIONS: + op.execute(""" + INSERT + INTO dvla_organisation + VALUES ('{}', '{}') + """.format(numeric_id, name)) + + +def downgrade(): + for numeric_id, _ in NEW_ORGANISATIONS: + op.execute(""" + DELETE + FROM dvla_organisation + WHERE id = '{}' + """.format(numeric_id))