Files
notifications-api/migrations/versions/0027_update_provider_rates.py
Kenneth Kehl d11a797008 fix tests
2023-07-17 14:11:11 -07:00

46 lines
1.3 KiB
Python

"""empty message
Revision ID: 0027_update_provider_rates
Revises: 0026_rename_notify_service
Create Date: 2016-06-08 01:00:00.000000
"""
# revision identifiers, used by Alembic.
from sqlalchemy import text
revision = '0027_update_provider_rates'
down_revision = '0026_rename_notify_service'
from alembic import op
import sqlalchemy as sa
from datetime import datetime
import uuid
def upgrade():
### commands auto generated by Alembic - please adjust! ###
conn = op.get_bind()
input_params = {
"id": uuid.uuid4(),
"time_now": datetime.utcnow()
}
conn.execute(text(
"INSERT INTO provider_rates (id, valid_from, rate, provider_id) VALUES (:id, :time_now, 1.8, "
"(SELECT id FROM provider_details WHERE identifier = 'mmg'))"), input_params)
input_params = {
"id": uuid.uuid4(),
"time_now": datetime.utcnow()
}
conn.execute(text(
"INSERT INTO provider_rates (id, valid_from, rate, provider_id) VALUES (:id, :time_now, 2.5, "
"(SELECT id FROM provider_details WHERE identifier = 'firetext'))"), input_params)
### end Alembic commands ###
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.get_bind()
op.execute("DELETE FROM provider_rates")
### end Alembic commands ###