mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-10 23:32:27 -05:00
45 lines
1.0 KiB
Python
45 lines
1.0 KiB
Python
"""empty message
|
|
|
|
Revision ID: 0375_fix_service_name
|
|
Revises: 0374_fix_reg_template_history
|
|
Create Date: 2022-08-29 11:04:15.888017
|
|
|
|
"""
|
|
|
|
from sqlalchemy import text
|
|
|
|
revision = "0375_fix_service_name"
|
|
down_revision = "0374_fix_reg_template_history"
|
|
|
|
from alembic import op
|
|
from flask import current_app
|
|
|
|
service_id = current_app.config["NOTIFY_SERVICE_ID"]
|
|
|
|
|
|
def upgrade():
|
|
conn = op.get_bind()
|
|
|
|
# modify name of default service user in services
|
|
# table_name = 'services'
|
|
# col = 'name'
|
|
# val = 'US Notify'
|
|
# select_by_col = 'id'
|
|
# select_by_val = service_id
|
|
input_params = {"service_id": service_id}
|
|
conn.execute(
|
|
text("update services set name='US Notify' where id =:service_id"), input_params
|
|
)
|
|
|
|
# table_name = 'services_history'
|
|
conn.execute(
|
|
text("update services_history set name='US Notify' where id =:service_id"),
|
|
input_params,
|
|
)
|
|
|
|
|
|
def downgrade():
|
|
### commands auto generated by Alembic - please adjust! ###
|
|
pass
|
|
### end Alembic commands ###
|