mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-10 15:22:24 -05:00
Merge pull request #3527 from alphagov/fix-apr-rate
add revision to fix apr rate
This commit is contained in:
34
migrations/versions/0370_fix_apr_2022_sms_rate.py
Normal file
34
migrations/versions/0370_fix_apr_2022_sms_rate.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0370_fix_apr_2022_sms_rate
|
||||
Revises: 0369_update_sms_rates
|
||||
Create Date: 2022-04-26 09:39:45.260951
|
||||
|
||||
"""
|
||||
import uuid
|
||||
|
||||
from alembic import op
|
||||
|
||||
revision = '0370_fix_apr_2022_sms_rate'
|
||||
down_revision = '0369_update_sms_rates'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.execute(
|
||||
"INSERT INTO rates(id, valid_from, rate, notification_type) "
|
||||
f"VALUES('{uuid.uuid4()}', '2022-03-31 23:00:00', 0.0161, 'sms')"
|
||||
)
|
||||
op.execute(
|
||||
"""
|
||||
UPDATE ft_billing
|
||||
SET rate = 0.0161
|
||||
WHERE
|
||||
notification_type = 'sms' AND
|
||||
bst_date >= '2022-04-01' AND
|
||||
bst_date < '2022-05-01'
|
||||
"""
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
pass
|
||||
Reference in New Issue
Block a user