Remove redundant owner index from devices table
The unique (owner_type, owner_id, token) index already serves queries filtering by (owner_type, owner_id) via its leftmost prefix. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
class RemoveRedundantOwnerIndexFromActionPushNativeDevices < ActiveRecord::Migration[8.2]
|
||||
def change
|
||||
remove_index :action_push_native_devices, column: [ :owner_type, :owner_id ]
|
||||
end
|
||||
end
|
||||
Generated
-1
@@ -79,7 +79,6 @@ ActiveRecord::Schema[8.2].define(version: 2026_02_18_120000) do
|
||||
t.string "token", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["owner_type", "owner_id", "token"], name: "idx_on_owner_type_owner_id_token_95a4008c64", unique: true
|
||||
t.index ["owner_type", "owner_id"], name: "index_action_push_native_devices_on_owner"
|
||||
t.index ["session_id"], name: "index_action_push_native_devices_on_session_id"
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user