Bound by custom field name
This commit is contained in:
parent
bfb0e87012
commit
64567d9766
|
@ -6,7 +6,10 @@ class CopySolvedTopicCustomFieldToDiscourseSolvedSolvedTopics < ActiveRecord::Mi
|
|||
BATCH_SIZE = 10_000
|
||||
|
||||
def up
|
||||
max_id = DB.query_single("SELECT MAX(id) FROM topic_custom_fields").first
|
||||
max_id =
|
||||
DB.query_single(
|
||||
"SELECT MAX(id) FROM topic_custom_fields WHERE topic_custom_fields.name = 'accepted_answer_post_id'",
|
||||
).first
|
||||
return unless max_id
|
||||
|
||||
last_id = 0
|
||||
|
|
|
@ -8,7 +8,10 @@ class CopyRemainingSolvedTopicCustomFieldToDiscourseSolvedSolvedTopics < ActiveR
|
|||
BATCH_SIZE = 5000
|
||||
|
||||
def up
|
||||
max_id = DB.query_single("SELECT MAX(id) FROM topic_custom_fields").first
|
||||
max_id =
|
||||
DB.query_single(
|
||||
"SELECT MAX(id) FROM topic_custom_fields WHERE topic_custom_fields.name = 'accepted_answer_post_id'",
|
||||
).first
|
||||
return unless max_id
|
||||
|
||||
last_id = 0
|
||||
|
|
Loading…
Reference in New Issue