Skip to content

Commit

Permalink
Merge pull request #7277 from fjordllc/feature/add-index-to-reports-c…
Browse files Browse the repository at this point in the history
…reated-at

reports.created_atにインデックスを貼る
  • Loading branch information
komagata authored Feb 4, 2024
2 parents 9319511 + 0c79665 commit 170f536
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions db/migrate/20240202100641_add_index_to_reports_created_at.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddIndexToReportsCreatedAt < ActiveRecord::Migration[6.1]
def change
add_index :reports, :created_at
end
end
3 changes: 2 additions & 1 deletion 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: 2023_11_20_101451) do
ActiveRecord::Schema.define(version: 2024_02_02_100641) do

# These are extensions that must be enabled in order to support this database
enable_extension "pgcrypto"
Expand Down Expand Up @@ -602,6 +602,7 @@
t.boolean "wip", default: false, null: false
t.integer "emotion"
t.datetime "published_at"
t.index ["created_at"], name: "index_reports_on_created_at"
t.index ["user_id", "reported_on"], name: "index_reports_on_user_id_and_reported_on", unique: true
t.index ["user_id", "title"], name: "index_reports_on_user_id_and_title", unique: true
end
Expand Down

0 comments on commit 170f536

Please sign in to comment.