mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 09:21:39 -05:00
38
migrations/versions/0040_adjust_mmg_provider_rate.py
Normal file
38
migrations/versions/0040_adjust_mmg_provider_rate.py
Normal file
@@ -0,0 +1,38 @@
|
||||
"""mmg rates now set to 1.65 pence per sms
|
||||
|
||||
Revision ID: 0040_adjust_mmg_provider_rate
|
||||
Revises: 0039_fix_notifications
|
||||
Create Date: 2016-07-06 15:19:23.124212
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0040_adjust_mmg_provider_rate'
|
||||
down_revision = '0039_fix_notifications'
|
||||
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
conn = op.get_bind()
|
||||
conn.execute(
|
||||
sa.sql.text(("INSERT INTO provider_rates (id, valid_from, rate, provider_id) "
|
||||
"VALUES (:id, :valid_from, :rate, (SELECT id FROM provider_details WHERE identifier = 'mmg'))")),
|
||||
id=uuid.uuid4(),
|
||||
valid_from=datetime(2016, 7, 1),
|
||||
rate=1.65
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
conn = op.get_bind()
|
||||
conn.execute(("DELETE FROM provider_rates "
|
||||
"WHERE provider_id = (SELECT id FROM provider_details WHERE identifier = 'mmg') "
|
||||
"AND rate = 1.65"))
|
||||
### end Alembic commands ###
|
||||
Reference in New Issue
Block a user