X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cc5023d40182e503e8ba109fc86e09efd6337836..415910149bed2eef6ae818b7c059d413934df06e:/services/api/db/migrate/20140325175653_remove_kind_columns.rb diff --git a/services/api/db/migrate/20140325175653_remove_kind_columns.rb b/services/api/db/migrate/20140325175653_remove_kind_columns.rb index 1ecd5d527c..3303fd9db1 100644 --- a/services/api/db/migrate/20140325175653_remove_kind_columns.rb +++ b/services/api/db/migrate/20140325175653_remove_kind_columns.rb @@ -1,14 +1,20 @@ -class RemoveKindColumns < ActiveRecord::Migration +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + +class RemoveKindColumns < ActiveRecord::Migration[4.2] include CurrentApiClient def up remove_column :links, :head_kind remove_column :links, :tail_kind + remove_column :logs, :object_kind end def down add_column :links, :head_kind, :string add_column :links, :tail_kind, :string + add_column :logs, :object_kind, :string act_as_system_user do Link.all.each do |l| @@ -16,6 +22,10 @@ class RemoveKindColumns < ActiveRecord::Migration l.tail_kind = ArvadosModel::resource_class_for_uuid(l.tail_uuid).kind if l.tail_uuid l.save end + Log.all.each do |l| + l.object_kind = ArvadosModel::resource_class_for_uuid(l.object_uuid).kind if l.object_uuid + l.save + end end end end