r76984 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76983‎ | r76984 | r76985 >
Date:23:52, 18 November 2010
Author:reedy
Status:ok
Tags:
Comment:
As part of ArticleAssessmentPilot to ArticleFeedback renaming, have a way to rename the tables =)
Modified paths:
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/RenameTables.sql (added) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php
@@ -59,8 +59,18 @@
6060 dirname( __FILE__ ) . '/ArticleFeedback.sql'
6161 );
6262 } else {
63 - $updater->addExtensionUpdate( array( 'addTable', 'article_feedback',
64 - dirname( __FILE__ ) . '/ArticleFeedback.sql', true ) );
 63+ $dir = dirname( __FILE__ );
 64+ $db = $updater->getDB();
 65+
 66+ if ( !$db->tableExists( 'article_feedback' ) ) {
 67+ if ( $db->tableExists( 'article_assessment' ) ) {
 68+ $updater->addExtensionUpdate( array( 'addTable', 'article_feedback',
 69+ $dir . '/RenameTables.sql', true ) ); // Rename tables
 70+ } else {
 71+ $updater->addExtensionUpdate( array( 'addTable', 'article_feedback',
 72+ $dir . '/ArticleFeedback.sql', true ) ); // Initial install tables
 73+ }
 74+ }
6575 }
6676 return true;
6777 }
Index: trunk/extensions/ArticleFeedback/RenameTables.sql
@@ -0,0 +1,3 @@
 2+RENAME TABLE /*$wgDBprefix*/article_assessment_ratings TO /*$wgDBprefix*/article_feedback_ratings,
 3+ /*$wgDBprefix*/article_assessment TO /*$wgDBprefix*/article_feedback,
 4+ /*$wgDBprefix*/article_assessment_pages TO /*$wgDBprefix*/article_feedback_pages;
\ No newline at end of file
Property changes on: trunk/extensions/ArticleFeedback/RenameTables.sql
___________________________________________________________________
Added: svn:eol-style
15 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r77018God damn you spaces, r76984reedy13:39, 19 November 2010

Status & tagging log