Files
notifications-api/migrations/versions/0358_operator_channel.py
David McDonald d18bf2c48a Add operator channel migration
Looks identical to the government channel migration 354
2021-06-09 13:48:02 +01:00

23 lines
645 B
Python

"""
Revision ID: 0358_operator_channel
Revises: 0357_validate_constraint
Create Date: 2021-06-09 13:44:12.479191
"""
from alembic import op
revision = '0358_operator_channel'
down_revision = '0357_validate_constraint'
def upgrade():
op.execute("INSERT INTO broadcast_channel_types VALUES ('operator')")
def downgrade():
# This can't be downgraded if there are rows in service_broadcast_settings which
# have the channel set to operator or if broadcasts have already been sent on the
# operator channel - it would break foreign key constraints.
op.execute("DELETE FROM broadcast_channel_types WHERE name = 'operator'")