X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ccff8ce154b393512dd4b563853f63a9abeefba4..737dcc58241a06e32615624877d3301b90574227:/services/api/db/migrate/20140918153705_add_state_to_job.rb diff --git a/services/api/db/migrate/20140918153705_add_state_to_job.rb b/services/api/db/migrate/20140918153705_add_state_to_job.rb index 7b595a36cd..77310d3ac9 100644 --- a/services/api/db/migrate/20140918153705_add_state_to_job.rb +++ b/services/api/db/migrate/20140918153705_add_state_to_job.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class AddStateToJob < ActiveRecord::Migration include CurrentApiClient @@ -9,6 +13,8 @@ class AddStateToJob < ActiveRecord::Migration Job.update_all({state: 'Failed'}, ['state is null and success = ?', false]) Job.update_all({state: 'Complete'}, ['state is null and success = ?', true]) Job.update_all({state: 'Running'}, ['state is null and running = ?', true]) + # Locked/started, but not Running/Failed/Complete? Let's assume it failed. + Job.update_all({state: 'Failed'}, ['state is null and (is_locked_by_uuid is not null or started_at is not null)']) Job.update_all({state: 'Queued'}, ['state is null']) end end