r113863 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113862‎ | r113863 | r113864 >
Date:21:43, 14 March 2012
Author:wikinaut
Status:new
Tags:
Comment:
follow up r113839 fixes the initial database creation problem. relies on r113862 .
Modified paths:
  • /trunk/extensions/AJAXPoll/AJAXPoll.php (modified) (history)
  • /trunk/extensions/AJAXPoll/AJAXPoll_body.php (modified) (history)
  • /trunk/extensions/AJAXPoll/patches/create-table--ajaxpoll_info.sql (modified) (history)
  • /trunk/extensions/AJAXPoll/patches/create-table--ajaxpoll_vote.sql (modified) (history)
  • /trunk/extensions/AJAXPoll/patches/rename-table--poll_info.sql (added) (history)
  • /trunk/extensions/AJAXPoll/patches/rename-table--poll_vote.sql (added) (history)

Diff [purge]

Index: trunk/extensions/AJAXPoll/AJAXPoll_body.php
@@ -399,23 +399,38 @@
400400 } else {
401401 // >= 1.17 support
402402
403 - # poll_info.poll_title field was dropped in AJAXPoll version 1.72
404 - $updater->dropExtensionField(
405 - 'poll_info',
406 - 'poll_title',
407 - dirname( __FILE__ ) . '/patches/drop-field--poll_info-poll_title.sql'
408 - );
 403+ if ( $updater->extensionTableExists( 'poll_info' ) ) {
 404+ # poll_info.poll_title field was dropped in AJAXPoll version 1.72
 405+ $updater->dropExtensionField(
 406+ 'poll_info',
 407+ 'poll_title',
 408+ dirname( __FILE__ ) . '/patches/drop-field--poll_info-poll_title.sql'
 409+ );
 410+ $updater->addExtensionTable(
 411+ 'ajaxpoll_info',
 412+ dirname( __FILE__ ) . '/patches/rename-table--poll_info.sql'
 413+ );
 414+ } else {
 415+ $updater->addExtensionTable(
 416+ 'ajaxpoll_info',
 417+ dirname( __FILE__ ) . '/patches/create-table--ajaxpoll_info.sql'
 418+ );
 419+ }
409420
410 - $updater->addExtensionTable(
411 - 'ajaxpoll_info',
412 - dirname( __FILE__ ) . '/patches/create-table--ajaxpoll_info.sql'
413 - );
414 - $updater->addExtensionTable(
415 - 'ajaxpoll_vote',
416 - dirname( __FILE__ ) . '/patches/create-table--ajaxpoll_vote.sql'
417 - );
 421+ if ( $updater->extensionTableExists( 'poll_vote' ) ) {
 422+ $updater->addExtensionTable(
 423+ 'ajaxpoll_vote',
 424+ dirname( __FILE__ ) . '/patches/rename-table--poll_vote.sql'
 425+ );
 426+ } else {
 427+ $updater->addExtensionTable(
 428+ 'ajaxpoll_vote',
 429+ dirname( __FILE__ ) . '/patches/create-table--ajaxpoll_vote.sql'
 430+ );
 431+ }
418432
419433 }
 434+
420435 return true;
421436 }
422437
Index: trunk/extensions/AJAXPoll/AJAXPoll.php
@@ -19,7 +19,7 @@
2020 * @author Jack Phoenix <jack@countervandalism.net>
2121 * @author Thomas Gries
2222 * @maintainer Thomas Gries
23 - * @version 1.72
 23+ * @version 1.73
2424 * @link http://www.mediawiki.org/wiki/Extension:AJAX_Poll Documentation
2525 */
2626
@@ -31,7 +31,7 @@
3232 $wgExtensionCredits['parserhook'][] = array(
3333 'path' => __FILE__,
3434 'name' => 'AJAX Poll',
35 - 'version' => '1.72 20120314',
 35+ 'version' => '1.73 20120314',
3636 'author' => array( 'Dariusz Siedlecki', 'Jack Phoenix', 'Thomas Gries' ),
3737 'descriptionmsg' => 'ajaxpoll-desc',
3838 'url' => 'https://www.mediawiki.org/wiki/Extension:AJAX_Poll',
Index: trunk/extensions/AJAXPoll/patches/create-table--ajaxpoll_info.sql
@@ -1,4 +1,3 @@
2 -RENAME TABLE /*_*/poll_info TO /*_*/ajaxpoll_info;
32 CREATE TABLE IF NOT EXISTS /*_*/ajaxpoll_info (
43 `poll_id` varchar(32) NOT NULL PRIMARY KEY default '',
54 `poll_txt` text,
Index: trunk/extensions/AJAXPoll/patches/rename-table--poll_info.sql
@@ -0,0 +1 @@
 2+RENAME TABLE /*_*/poll_info TO /*_*/ajaxpoll_info;
Property changes on: trunk/extensions/AJAXPoll/patches/rename-table--poll_info.sql
___________________________________________________________________
Added: svn:eol-style
13 + native
Index: trunk/extensions/AJAXPoll/patches/create-table--ajaxpoll_vote.sql
@@ -1,4 +1,3 @@
2 -RENAME TABLE /*_*/poll_vote TO /*_*/ajaxpoll_vote;
32 CREATE TABLE IF NOT EXISTS /*_*/ajaxpoll_vote (
43 `poll_id` varchar(32) NOT NULL default '',
54 `poll_user` varchar(255) NOT NULL default '',
Index: trunk/extensions/AJAXPoll/patches/rename-table--poll_vote.sql
@@ -0,0 +1 @@
 2+RENAME TABLE /*_*/poll_vote TO /*_*/ajaxpoll_vote;
Property changes on: trunk/extensions/AJAXPoll/patches/rename-table--poll_vote.sql
___________________________________________________________________
Added: svn:eol-style
13 + native

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113839follow up r113837 oops, i forgot to make the corresponding database changes i...wikinaut20:28, 14 March 2012
r113862follow up r113836 added public function extensionTableExists.wikinaut21:41, 14 March 2012

Status & tagging log