mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-09 09:19:48 -04:00
reformat
This commit is contained in:
@@ -11,44 +11,49 @@ import sqlalchemy as sa
|
||||
from sqlalchemy import text
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
revision = '0140_sms_prefix_non_nullable'
|
||||
down_revision = '0139_migrate_sms_allowance_data'
|
||||
revision = "0140_sms_prefix_non_nullable"
|
||||
down_revision = "0139_migrate_sms_allowance_data"
|
||||
|
||||
|
||||
def upgrade():
|
||||
conn = op.get_bind()
|
||||
input_params = {
|
||||
"id": current_app.config['NOTIFY_SERVICE_ID']
|
||||
}
|
||||
conn.execute(text("""
|
||||
input_params = {"id": current_app.config["NOTIFY_SERVICE_ID"]}
|
||||
conn.execute(
|
||||
text(
|
||||
"""
|
||||
update services
|
||||
set prefix_sms = false
|
||||
where id = :id
|
||||
"""), input_params)
|
||||
"""
|
||||
),
|
||||
input_params,
|
||||
)
|
||||
|
||||
op.alter_column(
|
||||
'services',
|
||||
'prefix_sms',
|
||||
"services",
|
||||
"prefix_sms",
|
||||
existing_type=sa.BOOLEAN(),
|
||||
nullable=False,
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
|
||||
op.alter_column(
|
||||
'services',
|
||||
'prefix_sms',
|
||||
"services",
|
||||
"prefix_sms",
|
||||
existing_type=sa.BOOLEAN(),
|
||||
nullable=True,
|
||||
)
|
||||
|
||||
conn = op.get_bind()
|
||||
input_params = {
|
||||
"id": current_app.config['NOTIFY_SERVICE_ID']
|
||||
}
|
||||
conn.execute(text("""
|
||||
input_params = {"id": current_app.config["NOTIFY_SERVICE_ID"]}
|
||||
conn.execute(
|
||||
text(
|
||||
"""
|
||||
update services
|
||||
set prefix_sms = null
|
||||
where id = :id
|
||||
"""), input_params)
|
||||
"""
|
||||
),
|
||||
input_params,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user