mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 18:38:14 -04:00
reformat
This commit is contained in:
@@ -10,12 +10,14 @@ import sqlalchemy as sa
|
||||
from sqlalchemy import text
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
revision = '0345_move_broadcast_provider'
|
||||
down_revision = '0344_stubbed_not_nullable'
|
||||
revision = "0345_move_broadcast_provider"
|
||||
down_revision = "0344_stubbed_not_nullable"
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column('service_broadcast_settings', sa.Column('provider', sa.String(), nullable=True))
|
||||
op.add_column(
|
||||
"service_broadcast_settings", sa.Column("provider", sa.String(), nullable=True)
|
||||
)
|
||||
|
||||
sql = """
|
||||
select service_id, provider
|
||||
@@ -30,14 +32,11 @@ def upgrade():
|
||||
results = conn.execute(sql)
|
||||
restrictions = results.fetchall()
|
||||
for x in restrictions:
|
||||
input_params = {
|
||||
"service_id": x.service_id,
|
||||
"provider": x.provider
|
||||
}
|
||||
input_params = {"service_id": x.service_id, "provider": x.provider}
|
||||
conn.execute(text(insert_sql), input_params)
|
||||
|
||||
|
||||
def downgrade():
|
||||
# Downgrade does not try and fully undo the upgrade, in particular it does not
|
||||
# delete the rows added to the service_broadcast_settings table
|
||||
op.drop_column('service_broadcast_settings', 'provider')
|
||||
op.drop_column("service_broadcast_settings", "provider")
|
||||
|
||||
Reference in New Issue
Block a user