Skip to content

Commit

Permalink
Add/Remove Indexes - Allocator Table (#1118)
Browse files Browse the repository at this point in the history
* Remove unused index globus_uuid

* Fix rubocop issue

* Add missing missing indexes

* run migration

* fix rubocop issue

* Add index for ror_id

* Exclude schema.rb since it is auto-generated
  • Loading branch information
kaysiz authored Feb 15, 2024
1 parent 6431e09 commit 7c7d715
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
7 changes: 7 additions & 0 deletions db/migrate/20240209113122_remove_globus_uuid_index.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# frozen_string_literal: true

class RemoveGlobusUuidIndex < ActiveRecord::Migration[6.1]
def change
remove_index :allocator, column: :globus_uuid
end
end
9 changes: 9 additions & 0 deletions db/migrate/20240209120111_add_missing_indexes_to_allocator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

class AddMissingIndexesToAllocator < ActiveRecord::Migration[6.1]
def change
add_index :allocator, :deleted_at, name: "index_allocator_deleted_at"
add_index :allocator, :role_name, name: "index_allocator_role_name"
add_index :allocator, :ror_id, name: "index_allocator_ror_id"
end
end
9 changes: 5 additions & 4 deletions db/schema.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# frozen_string_literal: true

# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
Expand All @@ -12,7 +10,8 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2023_10_04_145109) do
ActiveRecord::Schema.define(version: 2024_02_09_120111) do

create_table "active_storage_attachments", charset: "utf8mb4", force: :cascade do |t|
t.string "name", limit: 191, null: false
t.string "record_type", null: false
Expand Down Expand Up @@ -85,8 +84,10 @@
t.bigint "logo_file_size"
t.datetime "logo_updated_at"
t.integer "doi_estimate", default: 0, null: false
t.index ["globus_uuid"], name: "index_allocator_on_globus_uuid"
t.index ["deleted_at"], name: "index_allocator_deleted_at"
t.index ["organization_type"], name: "index_allocator_organization_type"
t.index ["role_name"], name: "index_allocator_role_name"
t.index ["ror_id"], name: "index_allocator_ror_id"
t.index ["symbol"], name: "symbol", unique: true
end

Expand Down

0 comments on commit 7c7d715

Please sign in to comment.