rename foreign uuid attributes
authorTom Clegg <tom@clinicalfuture.com>
Mon, 8 Jul 2013 18:18:43 +0000 (14:18 -0400)
committerTom Clegg <tom@clinicalfuture.com>
Mon, 8 Jul 2013 18:18:50 +0000 (14:18 -0400)
41 files changed:
apps/workbench/app/controllers/collections_controller.rb
apps/workbench/app/controllers/groups_controller.rb
apps/workbench/app/controllers/users_controller.rb
apps/workbench/app/models/arvados_base.rb
apps/workbench/app/views/application/_arvados_object_attr.html.erb
apps/workbench/app/views/application/_index.html.erb
apps/workbench/app/views/groups/index.html.erb
apps/workbench/app/views/links/index.html.erb
apps/workbench/app/views/pipeline_instances/index.html.erb
apps/workbench/app/views/pipeline_templates/index.html.erb
apps/workbench/app/views/users/index.html.erb
doc/api/Collections.textile
doc/api/Jobs.textile
doc/api/authentication.textile
doc/api/methods.textile
doc/api/resources.textile
doc/install/install-api-server.md
sdk/python/arvados.py
services/api/app/controllers/application_controller.rb
services/api/app/controllers/arvados/v1/jobs_controller.rb
services/api/app/models/api_client_authorization.rb
services/api/app/models/arvados_model.rb
services/api/app/models/job.rb
services/api/app/models/job_task.rb
services/api/app/models/link.rb
services/api/app/models/user.rb
services/api/db/migrate/20130708163414_rename_foreign_uuid_attributes.rb [new file with mode: 0644]
services/api/db/schema.rb
services/api/lib/common_api_template.rb
services/api/lib/current_api_client.rb
services/api/script/crunch-dispatch.rb
services/api/test/fixtures/api_clients.yml
services/api/test/fixtures/authorized_keys.yml
services/api/test/fixtures/collections.yml
services/api/test/fixtures/humans.yml
services/api/test/fixtures/logs.yml
services/api/test/fixtures/specimens.yml
services/api/test/fixtures/traits.yml
services/api/test/fixtures/users.yml
services/api/test/fixtures/virtual_machines.yml
services/crunch/crunch-job

index 92d2ad0976cc838ec8d6e045d7c638e4ebd33b71..5c5e16b6da1c94e30ef89483c346737c9b3061b4 100644 (file)
@@ -27,7 +27,7 @@ class CollectionsController < ApplicationController
             c[:created_at] = l.head.created_at
           end
           c[:wanted] = true
-          if l.owner == current_user.uuid
+          if l.owner_uuid == current_user.uuid
             c[:wanted_by_me] = true
           end
         end
index a924db2dcefefe88cfe3242da12fd795d9fbaa97..daf8ab94ed60408517b45fbc2d20c3174baa292e 100644 (file)
@@ -4,13 +4,13 @@ class GroupsController < ApplicationController
   def index
     @groups = Group.limit(10000).all
     @group_uuids = @groups.collect &:uuid
-    @owned_users = User.where owner: @group_uuids
+    @owned_users = User.where owner_uuid: @group_uuids
     @links_from = Link.where link_class: 'permission', tail_uuid: @group_uuids
     @links_to = Link.where link_class: 'permission', head_uuid: @group_uuids
   end
 
   def show
-    @collections = Collection.where(owner: @object.uuid)
+    @collections = Collection.where(owner_uuid: @object.uuid)
     @names = {}
     @keep_flag = {}
     @pgp_hu_id = {}
index 62007ff1c709cf697b40c5b630cc011e7f96697f..e15dc23559361af08cee6026d8e9175d9275c90d 100644 (file)
@@ -22,7 +22,7 @@ class UsersController < ApplicationController
     # A Tutorial is a Link which has link_class "resources" and name
     # "wants", and is owned by the Tutorials Group (i.e., named
     # "Arvados Tutorials" and owned by the system user).
-    @tutorial_group = Group.where(owner: User.system.uuid,
+    @tutorial_group = Group.where(owner_uuid: User.system.uuid,
                                   name: 'Arvados Tutorials').first
     if @tutorial_group
       @tutorial_links = Link.where(tail_uuid: @tutorial_group.uuid,
index 6b8278d0ec5bee1c787218a25106567534de897f..83588f0aa0152341267da8766db19c96c57a6a80 100644 (file)
@@ -25,11 +25,11 @@ class ArvadosBase < ActiveRecord::Base
     @attribute_sortkey ||= {
       'id' => nil,
       'uuid' => '000',
-      'owner' => '001',
+      'owner_uuid' => '001',
       'created_at' => '002',
       'modified_at' => '003',
-      'modified_by_user' => '004',
-      'modified_by_client' => '005',
+      'modified_by_user_uuid' => '004',
+      'modified_by_client_uuid' => '005',
       'name' => '050',
       'tail_kind' => '100',
       'tail_uuid' => '100',
@@ -109,8 +109,8 @@ class ArvadosBase < ActiveRecord::Base
     @kind = resp[:kind]
 
     # these attrs can be modified by "save" -- we should update our copies
-    %w(uuid owner created_at
-       modified_at modified_by_user modified_by_client
+    %w(uuid owner_uuid created_at
+       modified_at modified_by_user_uuid modified_by_client_uuid
       ).each do |attr|
       if self.respond_to? "#{attr}=".to_sym
         self.send(attr + '=', resp[attr.to_sym])
@@ -216,18 +216,18 @@ class ArvadosBase < ActiveRecord::Base
   def editable?
     (current_user and current_user.is_active and
      (current_user.is_admin or
-      current_user.uuid == self.owner))
+      current_user.uuid == self.owner_uuid))
   end
 
   def attribute_editable?(attr)
-    if "created_at modified_at modified_by_user modified_by_client updated_at".index(attr.to_s)
+    if "created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at".index(attr.to_s)
       false
     elsif not (current_user.andand.is_active)
       false
-    elsif "uuid owner".index(attr.to_s) or current_user.is_admin
+    elsif "uuid owner_uuid".index(attr.to_s) or current_user.is_admin
       current_user.is_admin
     else
-      current_user.uuid == self.owner or current_user.uuid == self.uuid
+      current_user.uuid == self.owner_uuid or current_user.uuid == self.uuid
     end
   end
 
index 3809f59b9bb3852c684e4b5576d3892739a74a54..ce175cc2f6ffef61de573d3451971a62c753daff 100644 (file)
@@ -15,7 +15,7 @@
 </tr>
 <% end %>
 <% elsif attrvalue.is_a? String or attrvalue.respond_to? :to_s %>
-<tr class="<%= 'info' if %w(uuid owner created_at modified_at modified_by_user modified_by_client updated_at).index(attr.to_s).nil? %>">
+<tr class="<%= 'info' if %w(uuid owner_uuid created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at).index(attr.to_s).nil? %>">
   <td><%= attr %></td>
   <% if attr == 'uuid' and (uuid = attrvalue.split('-')).size == 3 %>
   <td><%= uuid[0..-2].join('-') %>-<b><%= uuid[-1] %></b></td>
index 632d61bc9b659ea42baaca24d27ff52bac8f0aef..888bcee74c7aedf824930e3a7ba1f1e38ac9f5e0 100644 (file)
@@ -6,7 +6,7 @@
 
 <% else %>
 
-<% attr_blacklist = 'created_at modified_at modified_by_user modified_by_client updated_at' %>
+<% attr_blacklist = 'created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at' %>
 
 <table class="table arv-index">
   <thead>
index bd8a33bf99601f66d8f8ef7a77bb9a2701a767c1..1e81518169207ed3255295edafc7a4c877ea4d78 100644 (file)
       </td><td>
         <%= g.name %>
       </td><td>
-        <%= g.owner %>
+        <%= g.owner_uuid %>
       </td><td>
         <%= @links_to.select { |x| x.head_uuid == g.uuid }.collect(&:tail_uuid).uniq.count %>
       </td><td>
         <%= @links_from.select { |x| x.tail_uuid == g.uuid }.collect(&:head_uuid).uniq.count %>
       </td><td>
-        <%= @owned_users.select { |x| x.owner == g.uuid }.count %> users<br />
+        <%= @owned_users.select { |x| x.owner_uuid == g.uuid }.count %> users<br />
       </td>
     </tr>
 
index 08d175d753c7fb7a2937ca3e23570c9b7a571b12..76e959a2431bb8fba448274b7585fe9c3c8d995f 100644 (file)
@@ -37,7 +37,7 @@
       </td>
 
       <td>
-        <% if current_user and (current_user.is_admin or current_user.uuid == link.owner) %>
+        <% if current_user and (current_user.is_admin or current_user.uuid == link.owner_uuid) %>
         <%= link_to raw('<i class="icon-trash"></i>'), { action: 'destroy', id: link.uuid }, { confirm: 'Delete this link?', method: 'delete' } %>
         <% end %>
       </td>
index dbf58a71ada4b7333ece9f01eda15c45ea06d8f0..f5b672d9166951b59a4be0abeea6c16e1f5d1d82 100644 (file)
@@ -38,7 +38,7 @@
       </td><td>
         <%= link_to_if_arvados_object ob.pipeline_template_uuid %>
       </td><td>
-        <%= link_to_if_arvados_object ob.owner %>
+        <%= link_to_if_arvados_object ob.owner_uuid %>
       </td><td>
         <% ob.components.each do |cname, c| %>
         <% status = if !(c.is_a?(Hash) && c[:job].is_a?(Hash)) then nil elsif c[:job][:success] then 'success' elsif c[:job][:running] then 'info' else 'warning' end %>
index 15caf7a3f530252e9b60f3910c8320919a21e2ee..18de526ae393441b3b71a28f17d8cdfa9ab2656f 100644 (file)
@@ -22,7 +22,7 @@
       </td><td>
         <%= ob.name %>
       </td><td>
-        <%= link_to_if_arvados_object ob.owner %>
+        <%= link_to_if_arvados_object ob.owner_uuid %>
       </td><td>
         <%= ob.components.collect { |k,v| k.to_s }.join(", ") %>
       </td>
index 0bcb714be9cfde2d7a7c76a9f4e80e9460e10504..442d47ef0ab2e3eb95565c033401a524bcba360b 100644 (file)
@@ -36,7 +36,7 @@
       </td><td>
         <%= render_editable_attribute u, 'is_admin', u.is_admin ? 'Admin' : 'No', "data-type" => "select", "data-source" => '[{value:1,text:"admin"},{value:0,text:"No"}]', "data-value" => u.is_admin ? "1" : "0" %>
       </td><td>
-        <%= render_editable_attribute u, 'owner' %>
+        <%= render_editable_attribute u, 'owner_uuid' %>
       </td><td>
         <%= render_editable_attribute u, 'default_owner' %>
       </td>
index a700e54eadc73d487645b796c029fd0f44614869..afebd33772fa0912ae4130039d3c66291ca5e4d3 100644 (file)
@@ -36,6 +36,6 @@ table(table table-bordered table-condensed).
 |*Property name*|*Value*|*Description*|
 |portable_data_hash|string||
 |redundancy|number||
-|redundancy_confirmed_by_client|string|API client|
+|redundancy_confirmed_by_client_uuid|string|API client|
 |redundancy_confirmed_at|datetime||
 |redundancy_confirmed_as|number||
index 8c374a4eebfef9b6883169afcc9a1a0fa61e6125..b9b08dcedb3423144cc38ee1d674ede65283775e 100644 (file)
@@ -31,7 +31,7 @@ GET https://{{ site.arvados_api_host }}/arvados/v1/jobs/queue
  
 POST https://{{ site.arvados_api_host }}/arvados/v1/jobs/queue
 _method=GET
-where[owner]=xyzzy-tpzed-a4lcehql0dv2u25
+where[owner_uuid]=xyzzy-tpzed-a4lcehql0dv2u25
 </pre>
 
 &rarr; Job resource list
@@ -57,7 +57,7 @@ table(table table-bordered table-condensed).
 |finished_at|datetime|When job finished running|Is null if job has not [yet] finished|
 |running|boolean|Whether the job is running||
 |success|boolean|Whether the job indicated successful completion|Is null if job has not finished|
-|is_locked_by|string|UUID of the user who has locked this job|Is null if job is not locked. The system user locks the job when starting the job, in order to prevent job attributes from being altered.|
+|is_locked_by_uuid|string|UUID of the user who has locked this job|Is null if job is not locked. The system user locks the job when starting the job, in order to prevent job attributes from being altered.|
 
 h3. Resource limits
 
index fea46bb9cdea2fccdb530a686ded39351573f616..e48be7df51e8554be9dc9088d3526e2faf2fe23d 100644 (file)
@@ -17,8 +17,8 @@ Many resources contain "actor" attributes like @modified_by@.  An @access_token@
 
 table(table table-bordered table-condensed).
 |Name|Type|Description|
-|modified_by_client|string|ID of API client|
-|modified_by_user|string|ID of authenticated user|
+|modified_by_client_uuid|string|ID of API client|
+|modified_by_user_uuid|string|ID of authenticated user|
 
 h2. Authorizing a client application
 
index 00656ceff8e79c9618088c0151d52c50d882a071..5b47d3f55d1d471bc2c0222cff174b2526645798 100644 (file)
@@ -12,11 +12,11 @@ h1. REST Methods
 h2(#index). Index, list, search
 
 <pre>
-GET https://{{ site.arvados_api_host }}/arvados/v1/groups?where[owner]=xyzzy-tpzed-a4lcehql0dv2u25
+GET https://{{ site.arvados_api_host }}/arvados/v1/groups?where[owner_uuid]=xyzzy-tpzed-a4lcehql0dv2u25
  
 POST https://{{ site.arvados_api_host }}/arvados/v1/groups
 _method=GET
-where[owner]=xyzzy-tpzed-a4lcehql0dv2u25
+where[owner_uuid]=xyzzy-tpzed-a4lcehql0dv2u25
 </pre>
 
 &rarr; Group resource list
index c83943317005e3015e51da24d96b9e229d86045b..038ce9dde9becae18ec0a70bcac97e7dac60eaeb 100644 (file)
@@ -25,8 +25,8 @@ table(table table-bordered table-condensed).
 |self_link|string|||
 |owner_uuid|string|UUID of owner (typically User or Project)|@mk2qn-tpzed-a4lcehql0dv2u25@|
 |created_at|datetime|When resource was created|@2013-01-21T22:17:39Z@|
-|modified_by_client|string|API client software which most recently modified the resource|@mk2qn-ozdt8-vq8l5qkzj7pr7h7@|
-|modified_by_user|string|Authenticated user, on whose behalf the client was acting when modifying the resource|@mk2qn-tpzed-a4lcehql0dv2u25@|
+|modified_by_client_uuid|string|API client software which most recently modified the resource|@mk2qn-ozdt8-vq8l5qkzj7pr7h7@|
+|modified_by_user_uuid|string|Authenticated user, on whose behalf the client was acting when modifying the resource|@mk2qn-tpzed-a4lcehql0dv2u25@|
 |modified_at|datetime|When resource was last modified|@2013-01-25T22:29:32Z@|
 
 h2. Attributes of resource lists
index f9535f2f4c37d169db72dfcef7938474e73a4aa8..b27f9c97748c8cd2914a3e35c91bd19788c2b633 100644 (file)
@@ -108,6 +108,6 @@ This should be
 
 In rails console
 
-     a = ApiClient.new(owner:1); a.save!
+     a = ApiClient.new(owner_uuid:'0'); a.save!
      x = ApiClientAuthorization.new(api_client_id:a.id, user_id:1); x.save; x.api_token
 
index 0ae5ad0c06df9c26ccccb455af4794200a155ade..f017b1e06e1acb0a02e6a577ec382e6f021a1198 100644 (file)
@@ -97,7 +97,7 @@ class job_setup:
                 task_input = f.as_manifest()
                 new_task_attrs = {
                     'job_uuid': current_job()['uuid'],
-                    'created_by_job_task': current_task()['uuid'],
+                    'created_by_job_task_uuid': current_task()['uuid'],
                     'sequence': if_sequence + 1,
                     'parameters': {
                         'input':task_input
index d212cd2218ce01efb2a395162b17089327debb59..9dd23e8d9a695ccb00b00775c5fd491b8d3c296a 100644 (file)
@@ -115,8 +115,8 @@ class ApplicationController < ActionController::Base
       or_references_me = "OR (#{table_name}.link_class in (#{model_class.sanitize 'permission'}, #{model_class.sanitize 'resources'}) AND #{model_class.sanitize current_user.uuid} IN (#{table_name}.head_uuid, #{table_name}.tail_uuid))"
     end
     @objects ||= model_class.
-      joins("LEFT JOIN links permissions ON permissions.head_uuid in (#{table_name}.owner, #{table_name}.uuid) AND permissions.tail_uuid in (#{sanitized_uuid_list}) AND permissions.link_class='permission'").
-      where("?=? OR #{table_name}.owner in (?) OR #{table_name}.uuid=? OR permissions.head_uuid IS NOT NULL #{or_references_me}",
+      joins("LEFT JOIN links permissions ON permissions.head_uuid in (#{table_name}.owner_uuid, #{table_name}.uuid) AND permissions.tail_uuid in (#{sanitized_uuid_list}) AND permissions.link_class='permission'").
+      where("?=? OR #{table_name}.owner_uuid in (?) OR #{table_name}.uuid=? OR permissions.head_uuid IS NOT NULL #{or_references_me}",
             true, current_user.is_admin,
             uuid_list,
             current_user.uuid)
@@ -199,7 +199,7 @@ class ApplicationController < ActionController::Base
       message << " hash provided with request"
       raise ArgumentError.new(message)
     end
-    %w(created_at modified_by_client modified_by_user modified_at).each do |x|
+    %w(created_at modified_by_client_uuid modified_by_user_uuid modified_at).each do |x|
       @attrs.delete x
     end
     @attrs
index 759f437fd580e647b35c9dc386580b0f9061cc6b..c330da512245a21f9166401428c2579713363038 100644 (file)
@@ -74,7 +74,7 @@ class Arvados::V1::JobsController < ApplicationController
     load_where_param
     @where.merge!({
                     started_at: nil,
-                    is_locked_by: nil,
+                    is_locked_by_uuid: nil,
                     cancelled_at: nil
                   })
     params[:order] ||= 'priority desc, created_at'
index c71d0dce4b7aa7abcc5170e641066bfb448b708e..e90d7980cd682192281f921fdab0b4ee2a7075eb 100644 (file)
@@ -7,12 +7,12 @@ class ApiClientAuthorization < ArvadosModel
   after_initialize :assign_random_api_token
 
   api_accessible :superuser, :extend => :common do |t|
-    t.add :owner
+    t.add :owner_uuid
     t.add :user_id
     t.add :api_client_id
     t.add :api_token
     t.add :created_by_ip_address
-    t.add :default_owner
+    t.add :default_owner_uuid
     t.add :expires_at
     t.add :last_used_at
     t.add :last_used_by_ip_address
@@ -22,13 +22,13 @@ class ApiClientAuthorization < ArvadosModel
     self.api_token ||= rand(2**256).to_s(36)
   end
 
-  def owner
+  def owner_uuid
     self.user.andand.uuid
   end
-  def owner_was
+  def owner_uuid_was
     self.user_id_changed? ? User.find(self.user_id_was).andand.uuid : self.user.andand.uuid
   end
-  def owner_changed?
+  def owner_uuid_changed?
     self.user_id_changed?
   end
 
@@ -43,15 +43,15 @@ class ApiClientAuthorization < ArvadosModel
     self.api_token_changed?
   end
 
-  def modified_by_client
+  def modified_by_client_uuid
     nil
   end
-  def modified_by_client=(x) end
+  def modified_by_client_uuid=(x) end
 
-  def modified_by_user
+  def modified_by_user_uuid
     nil
   end
-  def modified_by_user=(x) end
+  def modified_by_user_uuid=(x) end
 
   def modified_at
     nil
@@ -67,6 +67,6 @@ class ApiClientAuthorization < ArvadosModel
   def permission_to_update
     (permission_to_create and
      not self.user_id_changed? and
-     not self.owner_changed?)
+     not self.owner_uuid_changed?)
   end
 end
index c5c3dd2579111ba0d17a7f776996d43a30d88422..09b61413b4dcceb7d4166838a83276cc6cf70aa3 100644 (file)
@@ -4,8 +4,8 @@ class ArvadosModel < ActiveRecord::Base
   include CurrentApiClient      # current_user, current_api_client, etc.
 
   attr_protected :created_at
-  attr_protected :modified_by_user
-  attr_protected :modified_by_client
+  attr_protected :modified_by_user_uuid
+  attr_protected :modified_by_client_uuid
   attr_protected :modified_at
   before_create :ensure_permission_to_create
   before_update :ensure_permission_to_update
@@ -63,22 +63,22 @@ class ArvadosModel < ActiveRecord::Base
       return false
     end
     return true if current_user.is_admin
-    if self.owner_changed?
-      if current_user.uuid == self.owner or
-          current_user.can? write: self.owner
+    if self.owner_uuid_changed?
+      if current_user.uuid == self.owner_uuid or
+          current_user.can? write: self.owner_uuid
         # current_user is, or has :write permission on, the new owner
       else
-        logger.warn "User #{current_user.uuid} tried to change owner of #{self.class.to_s} #{self.uuid} to #{self.owner} but does not have permission to write to #{self.owner}"
+        logger.warn "User #{current_user.uuid} tried to change owner_uuid of #{self.class.to_s} #{self.uuid} to #{self.owner_uuid} but does not have permission to write to #{self.owner_uuid}"
         return false
       end
     end
-    if current_user.uuid == self.owner_was or
+    if current_user.uuid == self.owner_uuid_was or
         current_user.uuid == self.uuid or
-        current_user.can? write: self.owner_was
+        current_user.can? write: self.owner_uuid_was
       # current user is, or has :write permission on, the previous owner
       return true
     else
-      logger.warn "User #{current_user.uuid} tried to modify #{self.class.to_s} #{self.uuid} but does not have permission to write #{self.owner_was}"
+      logger.warn "User #{current_user.uuid} tried to modify #{self.class.to_s} #{self.uuid} but does not have permission to write #{self.owner_uuid_was}"
       return false
     end
   end
@@ -89,10 +89,10 @@ class ArvadosModel < ActiveRecord::Base
 
   def update_modified_by_fields
     self.created_at ||= Time.now
-    self.owner ||= current_default_owner
+    self.owner_uuid ||= current_default_owner
     self.modified_at = Time.now
-    self.modified_by_user = current_user ? current_user.uuid : nil
-    self.modified_by_client = current_api_client ? current_api_client.uuid : nil
+    self.modified_by_user_uuid = current_user ? current_user.uuid : nil
+    self.modified_by_client_uuid = current_api_client ? current_api_client.uuid : nil
   end
 
   def ensure_serialized_attribute_type
index e2fc19e852062b4f42267f3ebf8806c1205b3de9..9167d15d8adec8900af4740528a80b8daf8b0059 100644 (file)
@@ -28,7 +28,7 @@ class Job < ArvadosModel
     t.add :output
     t.add :success
     t.add :running
-    t.add :is_locked_by
+    t.add :is_locked_by_uuid
     t.add :log
     t.add :resource_limits
     t.add :tasks_summary
@@ -42,7 +42,7 @@ class Job < ArvadosModel
   end
 
   def self.queue
-    self.where('started_at is ? and is_locked_by is ? and cancelled_at is ?',
+    self.where('started_at is ? and is_locked_by_uuid is ? and cancelled_at is ?',
                nil, nil, nil).
       order('priority desc, created_at')
   end
@@ -50,7 +50,7 @@ class Job < ArvadosModel
   protected
 
   def ensure_script_version_is_commit
-    if self.is_locked_by and self.started_at
+    if self.is_locked_by_uuid and self.started_at
       # Apparently client has already decided to go for it. This is
       # needed to run a local job using a local working directory
       # instead of a commit-ish.
@@ -114,8 +114,8 @@ class Job < ArvadosModel
       elsif is_locked_by_was and is_locked_by_was != current_user.uuid
         logger.warn "User #{current_user.uuid} tried to steal lock on #{self.class.to_s} #{uuid_was} from #{is_locked_by_was}"
         false
-      elsif !is_locked_by.nil? and is_locked_by != current_user.uuid
-        logger.warn "User #{current_user.uuid} tried to lock #{self.class.to_s} #{uuid_was} with uuid #{is_locked_by}"
+      elsif !is_locked_by_uuid.nil? and is_locked_by_uuid != current_user.uuid
+        logger.warn "User #{current_user.uuid} tried to lock #{self.class.to_s} #{uuid_was} with uuid #{is_locked_by_uuid}"
         false
       else
         super
index 4616e9f8b6b667164f609498ec155c50653f8e6b..e2f7930087bbc4e6e131c33fbde9aada5966b7df 100644 (file)
@@ -8,7 +8,7 @@ class JobTask < ArvadosModel
 
   api_accessible :superuser, :extend => :common do |t|
     t.add :job_uuid
-    t.add :created_by_job_task
+    t.add :created_by_job_task_uuid
     t.add :sequence
     t.add :qsequence
     t.add :parameters
@@ -21,7 +21,7 @@ class JobTask < ArvadosModel
 
   def delete_created_job_tasks_if_failed
     if self.success == false and self.success != self.success_was
-      JobTask.delete_all ['created_by_job_task = ?', self.uuid]
+      JobTask.delete_all ['created_by_job_task_uuid = ?', self.uuid]
     end
   end
 
@@ -30,7 +30,7 @@ class JobTask < ArvadosModel
       # xxx qsequence should be sequential as advertised; for now at
       # least it's non-decreasing.
       JobTask.update_all(['qsequence = ?', (Time.now.to_f*10000000).to_i],
-                         ['created_by_job_task = ?', self.uuid])
+                         ['created_by_job_task_uuid = ?', self.uuid])
     end
   end
 end
index b685bb6d75cff206a4d9d6652a4f1c0846f799b9..af7226b6df2dbc9d20d258ac7ccd306de452a22e 100644 (file)
@@ -47,7 +47,7 @@ class Link < ArvadosModel
       where('uuid=?',head_uuid).
       first
     if head_obj
-      return true if head_obj.owner == current_user.uuid
+      return true if head_obj.owner_uuid == current_user.uuid
     end
 
     # Users with "can_grant" permission on an object can grant
index 68e23804c1f4479eeb1d82e5f536cd654428a694..2fb3df392698015eb38f139e89fc5baac99f4827 100644 (file)
@@ -40,10 +40,10 @@ class User < ArvadosModel
       next if target_uuid == self.uuid
       next if (group_permissions[target_uuid] and
                group_permissions[target_uuid][action])
-      if target.respond_to? :owner
-        next if target.owner == self.uuid
-        next if (group_permissions[target.owner] and
-                 group_permissions[target.owner][action])
+      if target.respond_to? :owner_uuid
+        next if target.owner_uuid == self.uuid
+        next if (group_permissions[target.owner_uuid] and
+                 group_permissions[target.owner_uuid][action])
       end
       return false
     end
diff --git a/services/api/db/migrate/20130708163414_rename_foreign_uuid_attributes.rb b/services/api/db/migrate/20130708163414_rename_foreign_uuid_attributes.rb
new file mode 100644 (file)
index 0000000..122571b
--- /dev/null
@@ -0,0 +1,16 @@
+class RenameForeignUuidAttributes < ActiveRecord::Migration
+  def change
+    rename_column :api_client_authorizations, :default_owner, :default_owner_uuid
+    [:api_clients, :authorized_keys, :collections,
+     :groups, :humans, :job_tasks, :jobs, :keep_disks,
+     :links, :logs, :nodes, :pipeline_instances, :pipeline_templates,
+     :repositories, :specimens, :traits, :users, :virtual_machines].each do |t|
+      rename_column t, :owner, :owner_uuid
+      rename_column t, :modified_by_client, :modified_by_client_uuid
+      rename_column t, :modified_by_user, :modified_by_user_uuid
+    end
+    rename_column :collections, :redundancy_confirmed_by_client, :redundancy_confirmed_by_client_uuid
+    rename_column :jobs, :is_locked_by, :is_locked_by_uuid
+    rename_column :job_tasks, :created_by_job_task, :created_by_job_task_uuid
+  end
+end
index 34d176357955043216a8306b9641ee3e5cc344b5..37a9586c901377eca89a8b72b6a3edb3c32c01e2 100644 (file)
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20130627184333) do
+ActiveRecord::Schema.define(:version => 20130708163414) do
 
   create_table "api_client_authorizations", :force => true do |t|
     t.string   "api_token",               :null => false
@@ -23,7 +23,7 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
     t.datetime "expires_at"
     t.datetime "created_at"
     t.datetime "updated_at"
-    t.string   "default_owner"
+    t.string   "default_owner_uuid"
   end
 
   add_index "api_client_authorizations", ["api_client_id"], :name => "index_api_client_authorizations_on_api_client_id"
@@ -33,15 +33,15 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "api_clients", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "owner_uuid"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "name"
     t.string   "url_prefix"
     t.datetime "created_at"
     t.datetime "updated_at"
-    t.boolean  "is_trusted",         :default => false
+    t.boolean  "is_trusted",              :default => false
   end
 
   add_index "api_clients", ["created_at"], :name => "index_api_clients_on_created_at"
@@ -49,10 +49,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
   add_index "api_clients", ["uuid"], :name => "index_api_clients_on_uuid", :unique => true
 
   create_table "authorized_keys", :force => true do |t|
-    t.string   "uuid",                 :null => false
-    t.string   "owner",                :null => false
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "uuid",                    :null => false
+    t.string   "owner_uuid",              :null => false
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "name"
     t.string   "key_type"
@@ -68,15 +68,15 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "collections", :force => true do |t|
     t.string   "locator"
-    t.string   "owner"
+    t.string   "owner_uuid"
     t.datetime "created_at"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "portable_data_hash"
     t.string   "name"
     t.integer  "redundancy"
-    t.string   "redundancy_confirmed_by_client"
+    t.string   "redundancy_confirmed_by_client_uuid"
     t.datetime "redundancy_confirmed_at"
     t.integer  "redundancy_confirmed_as"
     t.datetime "updated_at"
@@ -111,10 +111,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "groups", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
+    t.string   "owner_uuid"
     t.datetime "created_at"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "name"
     t.text     "description"
@@ -126,10 +126,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
   add_index "groups", ["uuid"], :name => "index_groups_on_uuid", :unique => true
 
   create_table "humans", :force => true do |t|
-    t.string   "uuid",               :null => false
-    t.string   "owner",              :null => false
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "uuid",                    :null => false
+    t.string   "owner_uuid",              :null => false
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.text     "properties"
     t.datetime "created_at"
@@ -140,9 +140,9 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "job_tasks", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "owner_uuid"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "job_uuid"
     t.integer  "sequence"
@@ -152,8 +152,8 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
     t.boolean  "success"
     t.datetime "created_at"
     t.datetime "updated_at"
-    t.string   "created_by_job_task"
-    t.integer  "qsequence",           :limit => 8
+    t.string   "created_by_job_task_uuid"
+    t.integer  "qsequence",                :limit => 8
   end
 
   add_index "job_tasks", ["created_at"], :name => "index_job_tasks_on_created_at"
@@ -165,9 +165,9 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "jobs", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "owner_uuid"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "submit_id"
     t.string   "script"
@@ -184,7 +184,7 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
     t.datetime "created_at"
     t.datetime "updated_at"
     t.string   "priority"
-    t.string   "is_locked_by"
+    t.string   "is_locked_by_uuid"
     t.string   "log"
     t.text     "tasks_summary"
     t.text     "resource_limits"
@@ -200,18 +200,18 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
   add_index "jobs", ["uuid"], :name => "index_jobs_on_uuid", :unique => true
 
   create_table "keep_disks", :force => true do |t|
-    t.string   "uuid",                                 :null => false
-    t.string   "owner",                                :null => false
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "uuid",                                      :null => false
+    t.string   "owner_uuid",                                :null => false
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
-    t.string   "ping_secret",                          :null => false
+    t.string   "ping_secret",                               :null => false
     t.string   "node_uuid"
     t.string   "filesystem_uuid"
     t.integer  "bytes_total"
     t.integer  "bytes_free"
-    t.boolean  "is_readable",        :default => true, :null => false
-    t.boolean  "is_writable",        :default => true, :null => false
+    t.boolean  "is_readable",             :default => true, :null => false
+    t.boolean  "is_writable",             :default => true, :null => false
     t.datetime "last_read_at"
     t.datetime "last_write_at"
     t.datetime "last_ping_at"
@@ -230,10 +230,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "links", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
+    t.string   "owner_uuid"
     t.datetime "created_at"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "tail_uuid"
     t.string   "tail_kind"
@@ -255,9 +255,9 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "logs", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "owner_uuid"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.string   "object_kind"
     t.string   "object_uuid"
     t.datetime "event_at"
@@ -280,10 +280,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "nodes", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
+    t.string   "owner_uuid"
     t.datetime "created_at"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.integer  "slot_number"
     t.string   "hostname"
@@ -303,16 +303,16 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "pipeline_instances", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
+    t.string   "owner_uuid"
     t.datetime "created_at"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "pipeline_template_uuid"
     t.string   "name"
     t.text     "components"
     t.boolean  "success"
-    t.boolean  "active",                 :default => false
+    t.boolean  "active",                  :default => false
     t.datetime "updated_at"
     t.text     "properties"
   end
@@ -323,10 +323,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "pipeline_templates", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
+    t.string   "owner_uuid"
     t.datetime "created_at"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "name"
     t.text     "components"
@@ -338,10 +338,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
   add_index "pipeline_templates", ["uuid"], :name => "index_pipeline_templates_on_uuid", :unique => true
 
   create_table "repositories", :force => true do |t|
-    t.string   "uuid",               :null => false
-    t.string   "owner",              :null => false
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "uuid",                    :null => false
+    t.string   "owner_uuid",              :null => false
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "name"
     t.string   "fetch_url"
@@ -355,10 +355,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "specimens", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
+    t.string   "owner_uuid"
     t.datetime "created_at"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "material"
     t.datetime "updated_at"
@@ -370,10 +370,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
   add_index "specimens", ["uuid"], :name => "index_specimens_on_uuid", :unique => true
 
   create_table "traits", :force => true do |t|
-    t.string   "uuid",               :null => false
-    t.string   "owner",              :null => false
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "uuid",                    :null => false
+    t.string   "owner_uuid",              :null => false
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "name"
     t.text     "properties"
@@ -386,10 +386,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
 
   create_table "users", :force => true do |t|
     t.string   "uuid"
-    t.string   "owner"
+    t.string   "owner_uuid"
     t.datetime "created_at"
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "email"
     t.string   "first_name"
@@ -399,7 +399,7 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
     t.text     "prefs"
     t.datetime "updated_at"
     t.string   "default_owner"
-    t.boolean  "is_active",          :default => false
+    t.boolean  "is_active",               :default => false
   end
 
   add_index "users", ["created_at"], :name => "index_users_on_created_at"
@@ -407,10 +407,10 @@ ActiveRecord::Schema.define(:version => 20130627184333) do
   add_index "users", ["uuid"], :name => "index_users_on_uuid", :unique => true
 
   create_table "virtual_machines", :force => true do |t|
-    t.string   "uuid",               :null => false
-    t.string   "owner",              :null => false
-    t.string   "modified_by_client"
-    t.string   "modified_by_user"
+    t.string   "uuid",                    :null => false
+    t.string   "owner_uuid",              :null => false
+    t.string   "modified_by_client_uuid"
+    t.string   "modified_by_user_uuid"
     t.datetime "modified_at"
     t.string   "hostname"
     t.datetime "created_at"
index 1dec3fa5b40b9d28713de240716111209d27d708..7b7478e25ba04609fad19055ef4349e46277646e 100644 (file)
@@ -6,10 +6,10 @@ module CommonApiTemplate
       t.add :kind
       t.add :etag
       t.add :uuid
-      t.add :owner
+      t.add :owner_uuid
       t.add :created_at
-      t.add :modified_by_client
-      t.add :modified_by_user
+      t.add :modified_by_client_uuid
+      t.add :modified_by_user_uuid
       t.add :modified_at
       t.add :updated_at
     end
index f7476a9bedf659fb2502305d4872a467c1ef995b..96009977cddcff5a8d59b34a28d8ddb377787aec 100644 (file)
@@ -12,7 +12,7 @@ module CurrentApiClient
   end
 
   def current_default_owner
-    # owner uuid for newly created objects
+    # owner_uuid for newly created objects
     ((current_api_client_authorization &&
       current_api_client_authorization.default_owner) ||
      (current_user && current_user.default_owner) ||
index dc739870ad3846ddc76455166a5030ada8d92a19..0bcb5d56c057738250b126fe131d2998925113c9 100755 (executable)
@@ -80,7 +80,7 @@ class Dispatcher
       end
 
       job_auth = ApiClientAuthorization.
-        new(user: User.where('uuid=?', job.modified_by_user).first,
+        new(user: User.where('uuid=?', job.modified_by_user_uuid).first,
             api_client_id: 0)
       job_auth.save
 
index a0f04df131a789a0439e3381f8b92c62f7ae5c3c..ff74b8ae1dc9098a1ebd059c76acb136a4455045 100644 (file)
@@ -4,8 +4,8 @@ one:
   uuid: MyString
   created_by_client: MyString
   created_by_user: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-01-23 10:02:24
   name: MyString
   url_prefix: MyString
@@ -14,8 +14,8 @@ two:
   uuid: MyString
   created_by_client: MyString
   created_by_user: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-01-23 10:02:24
   name: MyString
   url_prefix: MyString
index 3b7fe2d14283c566d22aff79497ac55e8b906a43..01f8901728dc77e02edd60e13501f670cae7ea72 100644 (file)
@@ -2,9 +2,9 @@
 
 one:
   uuid: MyString
-  owner: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  owner_uuid: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-06-06 14:35:19
   name: MyString
   key_type: MyString
@@ -14,9 +14,9 @@ one:
 
 two:
   uuid: MyString
-  owner: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  owner_uuid: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-06-06 14:35:19
   name: MyString
   key_type: MyString
index 76d8bbec8c7d063f217475bb1b5d3f051761b1ea..d89251070f22ccd839765c91da77d097fa3636e1 100644 (file)
@@ -5,13 +5,13 @@ one:
   created_by_client: MyString
   created_by_user: MyString
   created_at: 2012-10-15 20:50:09
-  modified_by_client: MyString
-  modified_by_user: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2012-10-15 20:50:09
   portable_data_hash: MyString
   name: MyString
   redundancy: 1
-  redundancy_confirmed_by_client: MyString
+  redundancy_confirmed_by_client_uuid: MyString
   redundancy_confirmed_at: 2012-10-15 20:50:09
   redundancy_confirmed_as: 1
 
@@ -20,12 +20,12 @@ two:
   created_by_client: MyString
   created_by_user: MyString
   created_at: 2012-10-15 20:50:09
-  modified_by_client: MyString
-  modified_by_user: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2012-10-15 20:50:09
   portable_data_hash: MyString
   name: MyString
   redundancy: 1
-  redundancy_confirmed_by_client: MyString
+  redundancy_confirmed_by_client_uuid: MyString
   redundancy_confirmed_at: 2012-10-15 20:50:09
   redundancy_confirmed_as: 1
index e93e9a5ec62116a9e6d86b01a4b0a3b650b32ad5..cf83af44b4dc2fa72e927540e4f8cda4e5bc2a79 100644 (file)
@@ -2,16 +2,16 @@
 
 one:
   uuid: MyString
-  owner: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  owner_uuid: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-06-27 14:43:33
   properties: MyText
 
 two:
   uuid: MyString
-  owner: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  owner_uuid: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-06-27 14:43:33
   properties: MyText
index c892854a9faad13ac288a628ec2773b28fe7f2a8..ec6597e5d69a4ddfda071faf80e38549f0409019 100644 (file)
@@ -4,8 +4,8 @@ one:
   uuid: MyString
   created_by_client: MyString
   created_by_user: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   object_kind: MyString
   object_uuid: MyString
   event_at: 2013-01-22 12:14:42
@@ -17,8 +17,8 @@ two:
   uuid: MyString
   created_by_client: MyString
   created_by_user: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   object_kind: MyString
   object_uuid: MyString
   event_at: 2013-01-22 12:14:42
index 17aa8a7b5ed80979a2fa81afa5d1e0f0bfc60a57..2b1deb807402cc701cee9542f5fb3353a9bc5062 100644 (file)
@@ -6,8 +6,8 @@ one:
   created_by_client: MyString
   created_by_user: MyString
   modified_at: 2013-01-15 18:42:33
-  modified_by_client: MyString
-  modified_by_user: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   material: MyString
 
 two:
@@ -16,6 +16,6 @@ two:
   created_by_client: MyString
   created_by_user: MyString
   modified_at: 2013-01-15 18:42:33
-  modified_by_client: MyString
-  modified_by_user: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   material: MyString
index 594081f3cacdb55ddc8a0d3114181416d95b6181..5cd827c38bcdb5d40c94975de2152e1449aa722e 100644 (file)
@@ -2,18 +2,18 @@
 
 one:
   uuid: MyString
-  owner: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  owner_uuid: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-06-27 11:45:37
   name: MyString
   properties: MyText
 
 two:
   uuid: MyString
-  owner: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  owner_uuid: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-06-27 11:45:37
   name: MyString
   properties: MyText
index d39ebae65ccc7c4001919914ae443345d9ad8759..d124cec5499fee9c782b9a20a8f19a93cd890dd1 100644 (file)
@@ -5,8 +5,8 @@ one:
   created_by_client: MyString
   created_by_user: MyString
   created_at: 2013-01-21 21:00:42
-  modified_by_client: MyString
-  modified_by_user: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-01-21 21:00:42
   email: MyString
   first_name: MyString
@@ -20,8 +20,8 @@ two:
   created_by_client: MyString
   created_by_user: MyString
   created_at: 2013-01-21 21:00:42
-  modified_by_client: MyString
-  modified_by_user: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-01-21 21:00:42
   email: MyString
   first_name: MyString
index 23b32c9407cea4c4dc2e93af99bec7c3a9d4afdf..03698cda9fcc5a8584a2be23349df2df9c647ac3 100644 (file)
@@ -2,16 +2,16 @@
 
 one:
   uuid: MyString
-  owner: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  owner_uuid: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-06-08 01:37:30
   hostname: MyString
 
 two:
   uuid: MyString
-  owner: MyString
-  modified_by_client: MyString
-  modified_by_user: MyString
+  owner_uuid: MyString
+  modified_by_client_uuid: MyString
+  modified_by_user_uuid: MyString
   modified_at: 2013-06-08 01:37:30
   hostname: MyString
index 8c50ba6eaf5ab710537db8f5496077f0f90ec245..4ab942b487356d4b85dd9ba30417b7240e9cca42 100755 (executable)
@@ -130,8 +130,8 @@ if ($job_has_uuid)
 {
   $Job = $arv->{'jobs'}->{'get'}->execute('uuid' => $jobspec);
   if (!$force_unlock) {
-    if ($Job->{'is_locked_by'}) {
-      croak("Job is locked: " . $Job->{'is_locked_by'});
+    if ($Job->{'is_locked_by_uuid'}) {
+      croak("Job is locked: " . $Job->{'is_locked_by_uuid'});
     }
     if ($Job->{'success'} ne undef) {
       croak("Job 'success' flag (" . $Job->{'success'} . ") is not null");
@@ -154,7 +154,7 @@ else
     qw(script script_version script_parameters);
   }
 
-  $Job->{'is_locked_by'} = $User->{'uuid'};
+  $Job->{'is_locked_by_uuid'} = $User->{'uuid'};
   $Job->{'started_at'} = gmtime;
 
   $Job = $arv->{'jobs'}->{'create'}->execute('job' => $Job);
@@ -251,7 +251,7 @@ if ($job_has_uuid)
 {
   # Claim this job, and make sure nobody else does
 
-  $Job->{'is_locked_by'} = $User->{'uuid'};
+  $Job->{'is_locked_by_uuid'} = $User->{'uuid'};
   $Job->{'started_at'} = gmtime;
   $Job->{'running'} = 1;
   $Job->{'success'} = undef;
@@ -260,7 +260,7 @@ if ($job_has_uuid)
                               'running' => 0,
                               'done' => 0 };
   if ($job_has_uuid) {
-    unless ($Job->save() && $Job->{'is_locked_by'} == $User->{'uuid'}) {
+    unless ($Job->save() && $Job->{'is_locked_by_uuid'} == $User->{'uuid'}) {
       croak("Error while updating / locking job");
     }
   }
@@ -829,7 +829,7 @@ sub reapchildren
   # Load new tasks
   my $newtask_list = $arv->{'job_tasks'}->{'list'}->execute(
     'where' => {
-      'created_by_job_task' => $Jobstep->{'arvados_task'}->{uuid}
+      'created_by_job_task_uuid' => $Jobstep->{'arvados_task'}->{uuid}
     },
     'order' => 'qsequence'
   );