Commit 6fd891f6 authored by Sean Arnold's avatar Sean Arnold Committed by Douglas Barbosa Alexandre

Move to post-migrate, mark job as succeeded

parent 6e23fc3e
......@@ -9,12 +9,23 @@ module Gitlab
def perform(start_id, stop_id)
ActiveRecord::Base.connection.execute <<~SQL
INSERT INTO incident_management_issuable_escalation_statuses (issue_id, created_at, updated_at)
SELECT issues.id, now(), now()
SELECT issues.id, current_timestamp, current_timestamp
FROM issues
WHERE issues.issue_type = 1
AND issues.id BETWEEN #{start_id} AND #{stop_id}
ON CONFLICT (issue_id) DO NOTHING;
SQL
mark_job_as_succeeded(start_id, stop_id)
end
private
def mark_job_as_succeeded(*arguments)
::Gitlab::Database::BackgroundMigrationJob.mark_all_as_succeeded(
self.class.name.demodulize,
arguments
)
end
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment