Files
notifications-api/migrations/versions/0308_delete_loadtesting_provider.py

45 lines
1.1 KiB
Python
Raw Normal View History

2019-10-23 12:00:34 +01:00
"""
Remove loadtesting provider
Revision ID: 0308_delete_loadtesting_provider
Revises: 0307_delete_dm_datetime
Create Date: 2019-10-22 17:30
"""
import uuid
2019-10-23 12:00:34 +01:00
from alembic import op
from sqlalchemy.sql import text
2023-08-29 14:54:30 -07:00
revision = "0308_delete_loadtesting_provider"
down_revision = "0307_delete_dm_datetime"
2019-10-23 12:00:34 +01:00
def upgrade():
conn = op.get_bind()
conn.execute("DELETE FROM provider_details WHERE identifier = 'loadtesting'")
2023-08-29 14:54:30 -07:00
conn.execute(
"DELETE FROM provider_details_history WHERE identifier = 'loadtesting'"
)
2019-10-23 12:00:34 +01:00
def downgrade():
conn = op.get_bind()
conn.execute(
2023-08-29 14:54:30 -07:00
text(
"""
2019-10-23 12:00:34 +01:00
INSERT INTO
provider_details
(id, display_name, identifier, priority, notification_type, active, version, supports_international)
VALUES
(:uuid, 'Loadtesting', 'loadtesting', 100, 'sms', true, 1, false);
INSERT INTO
provider_details_history
(id, display_name, identifier, priority, notification_type, active, version, supports_international)
VALUES
(:uuid, 'Loadtesting', 'loadtesting', 100, 'sms', true, 1, false)
2023-08-29 14:54:30 -07:00
"""
),
uuid=uuid.uuid4(),
2019-10-23 12:00:34 +01:00
)