r33520 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r33519‎ | r33520 | r33521 >
Date:21:17, 17 April 2008
Author:aaron
Status:old (Comments)
Tags:
Comment:
Add user_last_timestamp field for diff from last view links. Discussed timestamp use for this w/ brion.
Modified paths:
  • /trunk/phase3/maintenance/archives/patch-user_last_timestamp.sql (added) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/updaters.inc
@@ -138,6 +138,7 @@
139139 array( 'add_table', 'category', 'patch-category.sql' ),
140140 array( 'do_category_population' ),
141141 array( 'add_field', 'archive', 'ar_parent_id', 'patch-ar_parent_id.sql'),
 142+ array( 'add_field', 'user_newtalk', 'user_last_timestamp', 'patch-user_last_timestamp.sql'),
142143 array( 'do_populate_parent_id' ),
143144 array( 'check_bin', 'protected_titles', 'pt_title', 'patch-pt_title-encoding.sql', ),
144145 );
Index: trunk/phase3/maintenance/archives/patch-user_last_timestamp.sql
@@ -0,0 +1,3 @@
 2+-- For getting diff since last view
 3+ALTER TABLE /*$wgDBprefix*/user_newtalk
 4+ ADD user_last_timestamp binary(14) NOT NULL default '';
Property changes on: trunk/phase3/maintenance/archives/patch-user_last_timestamp.sql
___________________________________________________________________
Added: svn:eol-style
15 + native
Index: trunk/phase3/maintenance/tables.sql
@@ -166,6 +166,9 @@
167167 -- If the user is an anonymous user their IP address is stored here
168168 -- since the user_id of 0 is ambiguous
169169 user_ip varbinary(40) NOT NULL default '',
 170+ -- The highest timestamp of revisions of the talk page viewed
 171+ -- by this user
 172+ user_last_timestamp binary(14) NOT NULL default '',
170173 INDEX user_id (user_id),
171174 INDEX user_ip (user_ip)
172175

Follow-up revisions

RevisionCommit summaryAuthorDate
r83137Fixed patch from r33520aaron06:28, 3 March 2011

Comments

#Comment by Tim Starling (talk | contribs)   05:42, 1 March 2011

binary(14) is not the correct type, it should varbinary(14) so that it can contain an empty string.

What is the idea of this? We can't update the user table on every logged-in page view, it'd cause too much write load.

#Comment by Aaron Schulz (talk | contribs)   07:52, 1 March 2011

If I recall, the row is only there is a new message for the user. This was used to make the "new message" diff show all the new talk page edits and not just the last one.

Status & tagging log