Skip to content

Commit

Permalink
Add a compund index on dataset and created
Browse files Browse the repository at this point in the history
  • Loading branch information
kaysiz committed Feb 14, 2024
1 parent 4df554d commit 45df4e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions db/migrate/20240214123201_add_indexes_to_media.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddIndexesToMedia < ActiveRecord::Migration[6.1]
def change
add_index :media, [:dataset, :created], name: "index_media_dataset_created"
end
end
6 changes: 3 additions & 3 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_14_123201) 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 @@ -277,6 +276,7 @@
t.text "url", null: false
t.integer "version"
t.bigint "dataset", null: false
t.index ["dataset", "created"], name: "index_media_dataset_created"
t.index ["dataset", "updated"], name: "dataset_updated"
t.index ["dataset"], name: "FK62F6FE44D3D6B1B"
t.index ["url"], name: "index_media_on_url", length: 100
Expand Down

0 comments on commit 45df4e0

Please sign in to comment.