Add card_id to index

This commit is contained in:
Jason Zimdars
2025-07-02 16:23:37 -05:00
parent aff0a38b37
commit 16535db20e
3 changed files with 11 additions and 4 deletions
@@ -0,0 +1,6 @@
class ChangeStepsIndex < ActiveRecord::Migration[8.1]
def change
remove_index :steps, :completed
add_index :steps, %i[ card_id completed ]
end
end
Generated
+2 -2
View File
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.1].define(version: 2025_07_02_160230) do
ActiveRecord::Schema[8.1].define(version: 2025_07_02_211937) do
create_table "accesses", force: :cascade do |t|
t.datetime "accessed_at"
t.integer "collection_id", null: false
@@ -331,8 +331,8 @@ ActiveRecord::Schema[8.1].define(version: 2025_07_02_160230) do
t.text "content", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["card_id", "completed"], name: "index_steps_on_card_id_and_completed"
t.index ["card_id"], name: "index_steps_on_card_id"
t.index ["completed"], name: "index_steps_on_completed"
end
create_table "taggings", force: :cascade do |t|
+3 -2
View File
@@ -2302,9 +2302,10 @@ indexes:
valid: true
- !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition
table: steps
name: index_steps_on_completed
name: index_steps_on_card_id_and_completed
unique: false
columns:
- card_id
- completed
lengths: {}
orders: {}
@@ -2451,4 +2452,4 @@ indexes:
comment:
valid: true
workflows: []
version: 20250702160230
version: 20250702211937