1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class RenameProjectsToGroups < ActiveRecord::Migration
7 rename_table :projects, :groups
8 rename_index :groups, :index_projects_on_created_at, :index_groups_on_created_at
9 rename_index :groups, :index_projects_on_modified_at, :index_groups_on_modified_at
10 rename_index :groups, :index_projects_on_uuid, :index_groups_on_uuid
11 Link.update_all({head_kind:'orvos#group'}, ['head_kind=?','orvos#project'])
12 Link.update_all({tail_kind:'orvos#group'}, ['tail_kind=?','orvos#project'])
13 Log.update_all({object_kind:'orvos#group'}, ['object_kind=?','orvos#project'])
17 Log.update_all({object_kind:'orvos#project'}, ['object_kind=?','orvos#group'])
18 Link.update_all({tail_kind:'orvos#project'}, ['tail_kind=?','orvos#group'])
19 Link.update_all({head_kind:'orvos#project'}, ['head_kind=?','orvos#group'])
20 rename_index :groups, :index_groups_on_created_at, :index_projects_on_created_at
21 rename_index :groups, :index_groups_on_modified_at, :index_projects_on_modified_at
22 rename_index :groups, :index_groups_on_uuid, :index_projects_on_uuid
23 rename_table :groups, :projects