mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-15 17:52:26 -05:00
Add operator channel migration
Looks identical to the government channel migration 354
This commit is contained in:
22
migrations/versions/0358_operator_channel.py
Normal file
22
migrations/versions/0358_operator_channel.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
|
||||
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'")
|
||||
Reference in New Issue
Block a user