diff --git a/db/migrate/20241022180133_add_summary_reference_to_events.rb b/db/migrate/20241022180133_add_summary_reference_to_events.rb index 1908b5b74..d15387eef 100644 --- a/db/migrate/20241022180133_add_summary_reference_to_events.rb +++ b/db/migrate/20241022180133_add_summary_reference_to_events.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 48022f68f..3db72af4c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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|