Index events con summary + action

This commit is contained in:
Jose Farias
2024-10-25 15:45:04 -06:00
parent 7b104287ba
commit 66fab4d0b0
2 changed files with 6 additions and 3 deletions
@@ -1,5 +1,8 @@
class AddSummaryReferenceToEvents < ActiveRecord::Migration[8.0]
def change
add_reference :events, :summary, foreign_key: { to_table: :event_summaries }
add_reference :events, :summary, foreign_key: { to_table: :event_summaries }, index: false
remove_index :events, %i[ bubble_id action ]
add_index :events, :bubble_id
add_index :events, %i[ summary_id action ]
end
end
Generated
+2 -2
View File
@@ -123,9 +123,9 @@ ActiveRecord::Schema[8.0].define(version: 2024_10_22_180133) do
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "summary_id"
t.index ["bubble_id", "action"], name: "index_events_on_bubble_id_and_action"
t.index ["bubble_id"], name: "index_events_on_bubble_id"
t.index ["creator_id"], name: "index_events_on_creator_id"
t.index ["summary_id"], name: "index_events_on_summary_id"
t.index ["summary_id", "action"], name: "index_events_on_summary_id_and_action"
end
create_table "messages", force: :cascade do |t|