Skip to content

Commit f93c9c4

Browse files
committed
Bound by custom field name
1 parent bfb0e87 commit f93c9c4

2 files changed

+2
-2
lines changed

db/migrate/20250318024953_copy_solved_topic_custom_field_to_discourse_solved_solved_topics.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class CopySolvedTopicCustomFieldToDiscourseSolvedSolvedTopics < ActiveRecord::Mi
66
BATCH_SIZE = 10_000
77

88
def up
9-
max_id = DB.query_single("SELECT MAX(id) FROM topic_custom_fields").first
9+
max_id = DB.query_single("SELECT MAX(id) FROM topic_custom_fields WHERE topic_custom_fields.name = 'accepted_answer_post_id'").first
1010
return unless max_id
1111

1212
last_id = 0

db/migrate/20250325074111_copy_remaining_solved_topic_custom_field_to_discourse_solved_solved_topics.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class CopyRemainingSolvedTopicCustomFieldToDiscourseSolvedSolvedTopics < ActiveR
88
BATCH_SIZE = 5000
99

1010
def up
11-
max_id = DB.query_single("SELECT MAX(id) FROM topic_custom_fields").first
11+
max_id = DB.query_single("SELECT MAX(id) FROM topic_custom_fields WHERE topic_custom_fields.name = 'accepted_answer_post_id'").first
1212
return unless max_id
1313

1414
last_id = 0

0 commit comments

Comments
 (0)