From 69d0e98d74c221ba2161b4851c51dd47ee7a9409 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Sun, 23 Mar 2014 23:02:43 -0400 Subject: [PATCH] Add output_is_persistent attribute to job model. --- services/api/app/models/job.rb | 1 + .../20140324024606_add_output_is_persistent_to_job.rb | 5 +++++ services/api/db/schema.rb | 7 ++++--- .../api/test/functional/arvados/v1/jobs_controller_test.rb | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 services/api/db/migrate/20140324024606_add_output_is_persistent_to_job.rb diff --git a/services/api/app/models/job.rb b/services/api/app/models/job.rb index 1f0ef758d9..a3fe08fdd9 100644 --- a/services/api/app/models/job.rb +++ b/services/api/app/models/job.rb @@ -27,6 +27,7 @@ class Job < ArvadosModel t.add :started_at t.add :finished_at t.add :output + t.add :output_is_persistent t.add :success t.add :running t.add :is_locked_by_uuid diff --git a/services/api/db/migrate/20140324024606_add_output_is_persistent_to_job.rb b/services/api/db/migrate/20140324024606_add_output_is_persistent_to_job.rb new file mode 100644 index 0000000000..04a03c0439 --- /dev/null +++ b/services/api/db/migrate/20140324024606_add_output_is_persistent_to_job.rb @@ -0,0 +1,5 @@ +class AddOutputIsPersistentToJob < ActiveRecord::Migration + def change + add_column :jobs, :output_is_persistent, :boolean, null: false, default: false + end +end diff --git a/services/api/db/schema.rb b/services/api/db/schema.rb index df6ea9b190..5c2fe2925d 100644 --- a/services/api/db/schema.rb +++ b/services/api/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140129184311) do +ActiveRecord::Schema.define(:version => 20140324024606) do create_table "api_client_authorizations", :force => true do |t| t.string "api_token", :null => false @@ -182,13 +182,14 @@ ActiveRecord::Schema.define(:version => 20140129184311) do t.boolean "running" t.boolean "success" t.string "output" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "priority" t.string "is_locked_by_uuid" t.string "log" t.text "tasks_summary" t.text "runtime_constraints" + t.boolean "output_is_persistent", :default => false, :null => false end add_index "jobs", ["created_at"], :name => "index_jobs_on_created_at" diff --git a/services/api/test/functional/arvados/v1/jobs_controller_test.rb b/services/api/test/functional/arvados/v1/jobs_controller_test.rb index f68cbc2dd2..7920bce068 100644 --- a/services/api/test/functional/arvados/v1/jobs_controller_test.rb +++ b/services/api/test/functional/arvados/v1/jobs_controller_test.rb @@ -14,6 +14,8 @@ class Arvados::V1::JobsControllerTest < ActionController::TestCase new_job = JSON.parse(@response.body) assert_not_nil new_job['uuid'] assert_not_nil new_job['script_version'].match(/^[0-9a-f]{40}$/) + # Default: not persistent + assert_equal false, new_job['output_is_persistent'] end test "normalize output and log uuids when creating job" do -- 2.30.2