Skip to content

Commit

Permalink
adding index for doi type. #612
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Aug 26, 2020
1 parent d74b229 commit 39f9914
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
1 change: 0 additions & 1 deletion db/migrate/20200718191826_add_type_to_doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ def up
remove_foreign_key "dataset", "datacentre"
add_column :dataset, :type, :string, limit: 16
change_column_default :dataset, :type, "DataCiteDoi"
add_index :dataset, [:type], name: "index_dataset_on_type", length: { type: 16 }
change_column_default :dataset, :agency, "datacite"
end

Expand Down
9 changes: 9 additions & 0 deletions db/migrate/20200826173254_add_agency_index.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class AddAgencyIndex < ActiveRecord::Migration[5.2]
def up
add_index :dataset, [:type], name: "index_dataset_on_type", length: { type: 16 }
end

def down
remove_index :dataset, name: "index_dataset_on_type"
end
end
6 changes: 3 additions & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2020_07_18_191826) do
ActiveRecord::Schema.define(version: 2020_08_26_173254) do

create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
t.string "name", limit: 191, null: false
Expand Down Expand Up @@ -111,7 +111,7 @@
t.datetime "created_at"
t.datetime "updated_at"
t.bigint "provider_prefix_id"
t.string "uid", null: false
t.string "uid"
t.index ["client_id", "prefix_id"], name: "index_client_prefixes_on_client_id_and_prefix_id", unique: true
t.index ["client_id"], name: "FK13A1B3BA47B5F5FF"
t.index ["prefix_id"], name: "FK13A1B3BAAF86A1C7"
Expand Down Expand Up @@ -286,7 +286,7 @@
t.datetime "created_at"
t.datetime "updated_at"
t.string "uuid"
t.string "uid", null: false
t.string "uid"
t.index ["prefix_id"], name: "FKE7FBD674AF86A1C7"
t.index ["provider_id", "prefix_id"], name: "index_provider_prefixes_on_provider_id_and_prefix_id", unique: true
t.index ["provider_id"], name: "FKE7FBD67446EBD781"
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/event.rake
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace :event do
cursor: ENV["CURSOR"].present? ? Base64.urlsafe_decode64(ENV["CURSOR"]).split(",", 2) : [],
filter: { update_target_doi: true },
query: ENV["QUERY"],
label: "[UpdateTargetDoi] Updating",
label: "[UpdateTargetDoi]",
job_name: "TargetDoiByIdJob",
}
Event.loop_through_events(options)
Expand Down

0 comments on commit 39f9914

Please sign in to comment.