[ARVADOS] updated: 80cbf4d912084fd80930cef112189024071eb4eb

git at public.curoverse.com git at public.curoverse.com
Thu Aug 28 11:18:46 EDT 2014


Summary of changes:
 services/api/app/models/job.rb                               |  2 +-
 services/api/db/migrate/20140828141043_job_priority_fixup.rb |  6 ++++--
 services/api/db/structure.sql                                | 11 ++---------
 services/api/test/fixtures/jobs.yml                          | 12 ++++++------
 .../api/test/functional/arvados/v1/jobs_controller_test.rb   |  2 +-
 5 files changed, 14 insertions(+), 19 deletions(-)

       via  80cbf4d912084fd80930cef112189024071eb4eb (commit)
      from  38dc6b9ddabb0e0e76128bfc4ff372f597d8e25e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 80cbf4d912084fd80930cef112189024071eb4eb
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Aug 28 11:18:44 2014 -0400

    3586: Migrate "priority" column so it is an integer instead of as string.

diff --git a/services/api/app/models/job.rb b/services/api/app/models/job.rb
index 4aeadcf..75de61c 100644
--- a/services/api/app/models/job.rb
+++ b/services/api/app/models/job.rb
@@ -75,7 +75,7 @@ class Job < ArvadosModel
 
   def set_priority
     if self.priority.nil?
-      self.priority = "0"
+      self.priority = 0
     end
     true
   end
diff --git a/services/api/db/migrate/20140828141043_job_priority_fixup.rb b/services/api/db/migrate/20140828141043_job_priority_fixup.rb
index 7f26812..f643a3f 100644
--- a/services/api/db/migrate/20140828141043_job_priority_fixup.rb
+++ b/services/api/db/migrate/20140828141043_job_priority_fixup.rb
@@ -1,9 +1,11 @@
 class JobPriorityFixup < ActiveRecord::Migration
   def up
-    change_column :jobs, :priority, :string, null: false, default: "0"
+    remove_column :jobs, :priority
+    add_column :jobs, :priority, :integer, null: false, default: 0
   end
 
   def down
-    change_column :jobs, :priority, :string, null: true, default: nil
+    remove_column :jobs, :priority
+    add_column :jobs, :priority, :string, null: true, default: nil
   end
 end
diff --git a/services/api/db/structure.sql b/services/api/db/structure.sql
index 62f81e0..55a93f3 100644
--- a/services/api/db/structure.sql
+++ b/services/api/db/structure.sql
@@ -420,7 +420,6 @@ CREATE TABLE jobs (
     output character varying(255),
     created_at timestamp without time zone NOT NULL,
     updated_at timestamp without time zone NOT NULL,
-    priority character varying(255) DEFAULT '0'::character varying NOT NULL,
     is_locked_by_uuid character varying(255),
     log character varying(255),
     tasks_summary text,
@@ -430,7 +429,8 @@ CREATE TABLE jobs (
     supplied_script_version character varying(255),
     docker_image_locator character varying(255),
     name character varying(255),
-    description text
+    description text,
+    priority integer DEFAULT 0 NOT NULL
 );
 
 
@@ -1811,13 +1811,6 @@ CREATE UNIQUE INDEX links_tail_name_unique_if_link_class_name ON links USING btr
 
 
 --
--- Name: pipeline_instance_owner_uuid_name_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
---
-
-CREATE UNIQUE INDEX pipeline_instance_owner_uuid_name_unique ON pipeline_instances USING btree (owner_uuid, name);
-
-
---
 -- Name: pipeline_template_owner_uuid_name_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
 --
 
diff --git a/services/api/test/fixtures/jobs.yml b/services/api/test/fixtures/jobs.yml
index 6c13be8..e677240 100644
--- a/services/api/test/fixtures/jobs.yml
+++ b/services/api/test/fixtures/jobs.yml
@@ -11,7 +11,7 @@ running:
   running: true
   success: ~
   output: ~
-  priority: "0"
+  priority: 0
   log: ~
   is_locked_by_uuid: zzzzz-tpzed-xurymjxw79nv3jz
   tasks_summary:
@@ -34,7 +34,7 @@ running_cancelled:
   running: true
   success: ~
   output: ~
-  priority: "0"
+  priority: 0
   log: ~
   is_locked_by_uuid: zzzzz-tpzed-xurymjxw79nv3jz
   tasks_summary:
@@ -57,7 +57,7 @@ uses_nonexistent_script_version:
   running: false
   success: true
   output: d41d8cd98f00b204e9800998ecf8427e+0
-  priority: "0"
+  priority: 0
   log: d41d8cd98f00b204e9800998ecf8427e+0
   is_locked_by_uuid: ~
   tasks_summary:
@@ -82,7 +82,7 @@ foobar:
   running: false
   success: true
   output: fa7aeb5140e2848d39b416daeef4ffc5+45
-  priority: "0"
+  priority: 0
   log: ea10d51bcf88862dbcc36eb292017dfd+45
   is_locked_by_uuid: ~
   tasks_summary:
@@ -109,7 +109,7 @@ barbaz:
   success: true
   repository: foo
   output: ea10d51bcf88862dbcc36eb292017dfd+45
-  priority: "0"
+  priority: 0
   log: d41d8cd98f00b204e9800998ecf8427e+0
   is_locked_by_uuid: ~
   tasks_summary:
@@ -207,7 +207,7 @@ queued:
   running: ~
   success: ~
   output: ~
-  priority: "0"
+  priority: 0
   log: ~
   is_locked_by_uuid: ~
   tasks_summary: {}
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 f8657b8..e8245a4 100644
--- a/services/api/test/functional/arvados/v1/jobs_controller_test.rb
+++ b/services/api/test/functional/arvados/v1/jobs_controller_test.rb
@@ -18,7 +18,7 @@ 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}$/)
-    assert_equal '0', new_job['priority']
+    assert_equal 0, new_job['priority']
   end
 
   test "normalize output and log uuids when creating job" do

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list