Page MenuHomePhabricator

Refactor Comment fields for CheckUser Component
Closed, DuplicatePublic

Description

This task derives from the work done in T166732.

The following changes should be made to ensure existing tables refer to the comment table for CheckUser:

  • cu_changes.cuc_commentcu_changes.cuc_comment_id (from CheckUser)
  • cu_log.cul_reasoncu_log.cul_reason_id (from CheckUser)
    • These two should be ignored when determining visibility in the Labs replication

Event Timeline

WDoranWMF triaged this task as Medium priority.Sep 10 2019, 8:31 PM

LGTM

CREATE ALGORITHM=UNDEFINED
DEFINER=`viewmaster`@`%`
SQL SECURITY DEFINER 
VIEW `comment` AS select `testwiki`.`comment`.`comment_id` AS `comment_id`,
`testwiki`.`comment`.`comment_hash` AS `comment_hash`,
`testwiki`.`comment`.`comment_text` AS `comment_text`,
`testwiki`.`comment`.`comment_data` AS `comment_data` from `testwiki`.`comment` 
where (
	exists(
		select 1 from `testwiki`.`image` where (`testwiki`.`image`.`img_description_id` = `testwiki`.`comment`.`comment_id`)
	) 
	or exists(
		select 1 from `testwiki`.`filearchive` where (`testwiki`.`filearchive`.`fa_deleted_reason_id` = `testwiki`.`comment`.`comment_id`)
	)
	or exists(
		select 1 from `testwiki`.`filearchive` where ((`testwiki`.`filearchive`.`fa_description_id` = `testwiki`.`comment`.`comment_id`) and ((`testwiki`.`filearchive`.`fa_deleted` & 2) = 0))
	)
	or exists(
		select 1 from `testwiki`.`ipblocks` where ((`testwiki`.`ipblocks`.`ipb_reason_id` = `testwiki`.`comment`.`comment_id`) and (`testwiki`.`ipblocks`.`ipb_deleted` = 0))
	)
	or exists(
		select 1 from `testwiki`.`oldimage` where ((`testwiki`.`oldimage`.`oi_description_id` = `testwiki`.`comment`.`comment_id`) and ((`testwiki`.`oldimage`.`oi_deleted` & 2) = 0))
	)
	or exists(
		select 1 from `testwiki`.`protected_titles` where (`testwiki`.`protected_titles`.`pt_reason_id` = `testwiki`.`comment`.`comment_id`)
	)
	or exists(
		select 1 from `testwiki`.`recentchanges` where ((`testwiki`.`recentchanges`.`rc_comment_id` = `testwiki`.`comment`.`comment_id`) and ((`testwiki`.`recentchanges`.`rc_deleted` & 2) = 0))
	)
	or exists(
		select 1 from (`testwiki`.`revision` join `testwiki`.`revision_comment_temp` on((`testwiki`.`revision_comment_temp`.`revcomment_rev` = `testwiki`.`revision`.`rev_id`))) where ((`testwiki`.`revision_comment_temp`.`revcomment_comment_id` = `testwiki`.`comment`.`comment_id`) and ((`testwiki`.`revision`.`rev_deleted` & 2) = 0))
	)
	or exists(
		select 1 from `testwiki`.`logging` where (
			(`testwiki`.`logging`.`log_comment_id` = `testwiki`.`comment`.`comment_id`)
			and ((`testwiki`.`logging`.`log_deleted` & 2) = 0) 
			and (`testwiki`.`logging`.`log_type` in 
				(
				'abusefilter','articlefeedbackv5','block','campus','close','contentmodel',
				'course','create','delete','eparticle','gather','gblblock','gblrename','gblrights',
				'globalauth','gwtoolset','import','institution','instructor','interwiki','liquidthreads',
				'lock','managetags','massmessage','merge','moodbar','move','mwoauthconsumer','newsletter',
				'newusers','notifytranslators','online','pagelang','pagetranslation','pagetriage-curation',
				'pagetriage-deletion','patrol','protect','renameuser','review','rights','spamblacklist',
				'stable','student','tag','thanks','timedmediahandler','translationreview','upload','usermerge'
				)
			)
		)
	)
)
Anomie subscribed.

Looks like T233004 is handling this already. Since there's more discussion on that on, I'm going to close this as the duplicate even though it's older.

@Anomie: thanks. Importantly, I tagged T233004 with Analytics as well, because we need to be in this loop. Closing this task had taken us out of the loop again.

I see now that the work is going ahead, and we can no plan accordingly.