hgaol opened a new pull request, #1315:
URL: https://github.com/apache/answer/pull/1315

   Close #1110 .
   
   ## Process when merging one tag to another.
   
   1. update the main tag id for source tag and its synonyms to target tag
   2. migrate tag followers from source tag to target tag
        1. check if they're both `tag.follow` action
        2. get all user ids who follow the source tag
        3. transaction
                1. cancel follow source tag. *(can changed to delete follow 
source tag records if needed)*
                2. update cancel status to active for target tag if source tag 
followers is active
                3. get user ids without following target tag, and create new 
activities to follow target tag for these users.
   3. update question tags
        1. update `tag_id` to target tag id in `tag_rel` table when all below 
conditions met
                1. `tag_id` equals source tag id
                2. `object_id` is with `question` prefix, which is `1001`
                3. questions without target tag. *Which means questions that 
already with target tag will be ignored*
        2. refresh question count for source tag and target tag
   
   ## Test cases validated
   
   1. questions. init state: questions1(t1, t2, t3), question2(t4), 
question3(t3)
        1. t2 -> t1: t2 becomes synonym of t1, questions1(t1, t2, t3), 
question2(t4), question3(t3)
        2. t4 -> t1: t4 becomes synonym of t1, questions1(t1, t2, t3), 
question2(t1), question3(t3)
        3. t3 -> t1: t3 becomes synonym of t1, questions1(t1, t2, t3), 
question2(t1), question3(t1)
        4. t1 remove t2,t3,t4 as syn: questions1(t1, t2, t3), question2(t1), 
question3(t1)
   2. followers. init state: t1, t2, t3 and t4 all have no followers
        1. follow t2 and merged to t1: following t1.
        2. unfollow t1 and merge t3 to t1: unfollowing t1.
        3. follow t4 and merge to t1: following t1.
        4. remove t2,3,4 as syn: following t1 and unfollowing t2,3,4
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@answer.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to