1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class RemoveKindColumns < ActiveRecord::Migration[4.2]
6 include CurrentApiClient
9 remove_column :links, :head_kind
10 remove_column :links, :tail_kind
11 remove_column :logs, :object_kind
15 add_column :links, :head_kind, :string
16 add_column :links, :tail_kind, :string
17 add_column :logs, :object_kind, :string
21 l.head_kind = ArvadosModel::resource_class_for_uuid(l.head_uuid).kind if l.head_uuid
22 l.tail_kind = ArvadosModel::resource_class_for_uuid(l.tail_uuid).kind if l.tail_uuid
26 l.object_kind = ArvadosModel::resource_class_for_uuid(l.object_uuid).kind if l.object_uuid