Files
notifications-api/migrations/versions/0099_tfl_dar.py
T

49 lines
940 B
Python
Raw Normal View History

2017-06-15 14:59:36 +01:00
"""empty message
2017-06-20 10:56:50 +01:00
Revision ID: 0099_tfl_dar
Revises: 0098_service_inbound_api
2017-06-15 14:59:36 +01:00
Create Date: 2017-06-05 16:15:17.744908
"""
# revision identifiers, used by Alembic.
2023-07-17 11:29:08 -07:00
from sqlalchemy import text
2023-08-29 14:54:30 -07:00
revision = "0099_tfl_dar"
down_revision = "0098_service_inbound_api"
2017-06-15 14:59:36 +01:00
import sqlalchemy as sa
2023-12-08 21:43:52 -05:00
from alembic import op
2017-06-15 14:59:36 +01:00
from sqlalchemy.dialects import postgresql
2023-08-29 14:54:30 -07:00
TFL_DAR_ID = "1d70f564-919b-4c68-8bdf-b8520d92516e"
2017-06-15 14:59:36 +01:00
def upgrade():
2023-07-17 11:29:08 -07:00
conn = op.get_bind()
2023-08-29 14:54:30 -07:00
input_params = {"tfl_dar_id": TFL_DAR_ID}
conn.execute(
text(
"""INSERT INTO organisation VALUES (
2023-07-17 11:29:08 -07:00
:tfl_dar_id,
2017-06-15 14:59:36 +01:00
'',
'tfl_dar_x2.png',
'tfl'
2023-08-29 14:54:30 -07:00
)"""
),
input_params,
)
2017-06-15 14:59:36 +01:00
def downgrade():
2023-07-17 11:29:08 -07:00
conn = op.get_bind()
2023-08-29 14:54:30 -07:00
input_params = {"tfl_dar_id": TFL_DAR_ID}
conn.execute(
text(
"""
2023-07-17 11:29:08 -07:00
DELETE FROM organisation WHERE "id" = :tfl_dar_id
2023-08-29 14:54:30 -07:00
"""
),
input_params,
)