mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Add ‘GP’ as an org type
Although their allowances are the same as what we call `nhs_local` it makes more sense to store them separately because: - we already present them as two separate choices to the user - we may want to handle them differently in the future, eg in terms of what branding choices are available to them
This commit is contained in:
42
migrations/versions/0305_add_gp_org_type.py
Normal file
42
migrations/versions/0305_add_gp_org_type.py
Normal file
@@ -0,0 +1,42 @@
|
||||
import os
|
||||
|
||||
"""
|
||||
|
||||
Revision ID: 0305_add_gp_org_type
|
||||
Revises: 0304_remove_org_to_service
|
||||
Create Date: 2019-07-24 16:18:27.467361
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
|
||||
|
||||
revision = '0305_add_gp_org_type'
|
||||
down_revision = '0304_remove_org_to_service'
|
||||
GP_ORG_TYPE_NAME = 'gp'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute("""
|
||||
INSERT INTO
|
||||
organisation_types
|
||||
(name, is_crown, annual_free_sms_fragment_limit)
|
||||
VALUES
|
||||
('{}', false, 25000)
|
||||
""".format(GP_ORG_TYPE_NAME))
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.execute("""
|
||||
UPDATE
|
||||
organisation
|
||||
SET
|
||||
organisation_type = 'nhs_local'
|
||||
WHERE
|
||||
organisation_type = '{}'
|
||||
""".format(GP_ORG_TYPE_NAME))
|
||||
op.execute("""
|
||||
DELETE FROM
|
||||
organisation_types
|
||||
WHERE
|
||||
name = '{}'
|
||||
""".format(GP_ORG_TYPE_NAME))
|
||||
Reference in New Issue
Block a user