X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/ccff8ce154b393512dd4b563853f63a9abeefba4..19ae770973482257117fe8ded5619c3018c4b60f:/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..20625c979c 100644 --- a/services/api/db/migrate/20140918153705_add_state_to_job.rb +++ b/services/api/db/migrate/20140918153705_add_state_to_job.rb @@ -9,6 +9,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