From: umherirrender Date: Sat, 9 Nov 2013 17:20:54 +0000 (+0100) Subject: Remove recentchanges.rc_cur_time from sql statements X-Git-Tag: 1.31.0-rc.0~18112^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=974562aee92a78be82cf8e1416ef44648bb7dbb7;p=lhc%2Fweb%2Fwiklou.git Remove recentchanges.rc_cur_time from sql statements Field is unused since many versions, so remove the use in sql statements, to allow dropping in a later version. The field must not be reference from INSERT because it has a default value, which is used, when no value is specified in the statement. Keeping the field allows easier rollback on version update, when something gets wrong with the new version. Existing Comment in tables.sql was added with r101293, was already disused in r11088 Bug: 40667 Change-Id: I4a9c2fa813d1f25dfb755e564f7677a212934d7b --- diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 8d4c9c113b..48a8d03cb8 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -26,7 +26,6 @@ * mAttribs: * rc_id id of the row in the recentchanges table * rc_timestamp time the entry was made - * rc_cur_time timestamp on the cur row * rc_namespace namespace # * rc_title non-prefixed db key * rc_type is new entry, used to determine whether updating is necessary @@ -155,7 +154,6 @@ class RecentChange { return array( 'rc_id', 'rc_timestamp', - 'rc_cur_time', 'rc_user', 'rc_user_text', 'rc_namespace', @@ -254,7 +252,6 @@ class RecentChange { # Fixup database timestamps $this->mAttribs['rc_timestamp'] = $dbw->timestamp( $this->mAttribs['rc_timestamp'] ); - $this->mAttribs['rc_cur_time'] = $dbw->timestamp( $this->mAttribs['rc_cur_time'] ); $this->mAttribs['rc_id'] = $dbw->nextSequenceValue( 'recentchanges_rc_id_seq' ); ## If we are using foreign keys, an entry of 0 for the page_id will fail, so use NULL @@ -495,7 +492,6 @@ class RecentChange { $rc->mPerformer = $user; $rc->mAttribs = array( 'rc_timestamp' => $timestamp, - 'rc_cur_time' => $timestamp, 'rc_namespace' => $title->getNamespace(), 'rc_title' => $title->getDBkey(), 'rc_type' => RC_EDIT, @@ -555,7 +551,6 @@ class RecentChange { $rc->mPerformer = $user; $rc->mAttribs = array( 'rc_timestamp' => $timestamp, - 'rc_cur_time' => $timestamp, 'rc_namespace' => $title->getNamespace(), 'rc_title' => $title->getDBkey(), 'rc_type' => RC_NEW, @@ -665,7 +660,6 @@ class RecentChange { $rc->mPerformer = $user; $rc->mAttribs = array( 'rc_timestamp' => $timestamp, - 'rc_cur_time' => $timestamp, 'rc_namespace' => $target->getNamespace(), 'rc_title' => $target->getDBkey(), 'rc_type' => RC_LOG, @@ -721,7 +715,6 @@ class RecentChange { wfDeprecated( __METHOD__, '1.22' ); $this->mAttribs = array( 'rc_timestamp' => wfTimestamp( TS_MW, $row->rev_timestamp ), - 'rc_cur_time' => $row->rev_timestamp, 'rc_user' => $row->rev_user, 'rc_user_text' => $row->rev_user_text, 'rc_namespace' => $row->page_namespace, diff --git a/maintenance/rebuildrecentchanges.php b/maintenance/rebuildrecentchanges.php index 315176c12c..b9eb809cd1 100644 --- a/maintenance/rebuildrecentchanges.php +++ b/maintenance/rebuildrecentchanges.php @@ -70,7 +70,6 @@ class RebuildRecentchanges extends Maintenance { $dbw->insertSelect( 'recentchanges', array( 'page', 'revision' ), array( 'rc_timestamp' => 'rev_timestamp', - 'rc_cur_time' => 'rev_timestamp', 'rc_user' => 'rev_user', 'rc_user_text' => 'rev_user_text', 'rc_namespace' => 'page_namespace', @@ -185,7 +184,6 @@ class RebuildRecentchanges extends Maintenance { $dbw->insertSelect( 'recentchanges', array( 'user', "$logging LEFT JOIN $page ON (log_namespace=page_namespace AND log_title=page_title)" ), array( 'rc_timestamp' => 'log_timestamp', - 'rc_cur_time' => 'log_timestamp', 'rc_user' => 'log_user', 'rc_user_text' => 'user_name', 'rc_namespace' => 'log_namespace', diff --git a/maintenance/tables.sql b/maintenance/tables.sql index af01a30cc1..53964aa127 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -1026,6 +1026,8 @@ CREATE TABLE /*_*/recentchanges ( rc_timestamp varbinary(14) NOT NULL default '', -- This is no longer used + -- Field kept in database for downgrades + -- @todo: add drop patch with 1.24 rc_cur_time varbinary(14) NOT NULL default '', -- As in revision