mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-03 16:00:44 -05:00
Merge pull request #349 from alphagov/fix-migration
Remove the status from the group by clause of the update statement.
This commit is contained in:
@@ -26,13 +26,13 @@ def upgrade():
|
||||
if x.job_id:
|
||||
op.execute("update jobs set notifications_delivered = ("
|
||||
"select count(status) from notifications where status = 'delivered' and job_id = '{}' "
|
||||
"group by status, job_id)"
|
||||
"group by job_id)"
|
||||
"where jobs.id = '{}'".format(x.job_id, x.job_id))
|
||||
|
||||
op.execute("update jobs set notifications_failed = ("
|
||||
"select count(status) from notifications "
|
||||
"where status in ('failed','technical-failure', 'temporary-failure', 'permanent-failure') "
|
||||
"and job_id = '{}' group by status, job_id)"
|
||||
"and job_id = '{}' group by job_id)"
|
||||
"where jobs.id = '{}'".format(x.job_id, x.job_id))
|
||||
op.execute("update jobs set notifications_delivered = 0 where notifications_delivered is null")
|
||||
op.execute("update jobs set notifications_failed = 0 where notifications_failed is null")
|
||||
|
||||
Reference in New Issue
Block a user