Index: trunk/extensions/LiquidThreads/migrateFromPre51021.php |
— | — | @@ -0,0 +1,21 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +// Utility script to fix your database to work with breaking changes made in r51021 of |
| 5 | +// the LiquidThreads extension. |
| 6 | + |
| 7 | +// NOTE: This script may not work properly if you have taken advantage of the features made |
| 8 | +// possible by that revision (i.e. if you have set $wgLqtPages). |
| 9 | + |
| 10 | +require_once ( getenv('MW_INSTALL_PATH') !== false |
| 11 | + ? getenv('MW_INSTALL_PATH')."/maintenance/commandLine.inc" |
| 12 | + : dirname( __FILE__ ) . '/../../maintenance/commandLine.inc' ); |
| 13 | + |
| 14 | +$db = wfGetDB( DB_MASTER ); |
| 15 | + |
| 16 | +do { |
| 17 | + $db->update( 'thread', |
| 18 | + array( 'thread_article_namespace=thread_article_namespace+1' ), |
| 19 | + array( 'thread_article_namespace mod 2 = 0'), |
| 20 | + __METHOD__, |
| 21 | + array( 'LIMIT' => 500 ) ); |
| 22 | +} while ( $db->affectedRows() > 0 ); |