Skip to content

Commit 6e7cce0

Browse files
drusepthclaude
andcommitted
Fix broken migrations for production database
1. Remove duplicate migration that added cached_word_count to timelines (already added by 20221202003053 for all content types) 2. Fix performance index migration referencing non-existent 'status' column on page_collection_submissions - changed to index 'accepted_at' instead since submission status is derived from that column (nil = pending) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 6709a46 commit 6e7cce0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

db/migrate/20250922002531_add_performance_indexes_for_user_profiles.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ def change
8383
name: 'index_page_collections_on_user_updated'
8484
end
8585

86-
# Page collection submissions
86+
# Page collection submissions - index on accepted_at since status is derived from it
8787
if table_exists?(:page_collection_submissions)
88-
add_index :page_collection_submissions, [:user_id, :status],
89-
name: 'index_page_collection_submissions_on_user_status'
88+
add_index :page_collection_submissions, [:user_id, :accepted_at],
89+
name: 'index_page_collection_submissions_on_user_accepted'
9090
end
9191
end
9292
end

db/schema.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2466,10 +2466,10 @@
24662466
t.string "cached_content_name"
24672467
t.datetime "deleted_at"
24682468
t.integer "editor_pick_position"
2469-
t.index "\"user_id\", \"status\"", name: "index_page_collection_submissions_on_user_status"
24702469
t.index ["content_type", "content_id"], name: "polycontent_collection_index"
24712470
t.index ["page_collection_id", "editor_pick_position"], name: "index_page_collection_submissions_on_editor_pick_position", unique: true, where: "editor_pick_position IS NOT NULL"
24722471
t.index ["page_collection_id"], name: "index_page_collection_submissions_on_page_collection_id"
2472+
t.index ["user_id", "accepted_at"], name: "index_page_collection_submissions_on_user_accepted"
24732473
t.index ["user_id"], name: "index_page_collection_submissions_on_user_id"
24742474
end
24752475

0 commit comments

Comments
 (0)