+/**
+ * @package MediaWiki
+ * @subpackage Maintenance
+ */
+
+ /** */
+
+$wgNewTables = array(
+# table patch file (in maintenance/archives)
+ array( 'linkscc', 'patch-linkscc.sql' ),
+ array( 'hitcounter', 'patch-hitcounter.sql' ),
+ array( 'querycache', 'patch-querycache.sql' ),
+ array( 'objectcache', 'patch-objectcache.sql' ),
+ array( 'categorylinks', 'patch-categorylinks.sql' ),
+ array( 'logging', 'patch-logging.sql' ),
+ array( 'user_rights', 'patch-user_rights.sql' ),
+);
+
+$wgNewFields = array(
+# table field patch file (in maintenance/archives)
+ array( 'ipblocks', 'ipb_id', 'patch-ipblocks.sql' ),
+ array( 'ipblocks', 'ipb_expiry', 'patch-ipb_expiry.sql' ),
+ array( 'recentchanges', 'rc_type', 'patch-rc_type.sql' ),
+ array( 'recentchanges', 'rc_ip', 'patch-rc_ip.sql' ),
+ array( 'recentchanges', 'rc_id', 'patch-rc_id.sql' ),
+ array( 'recentchanges', 'rc_patrolled', 'patch-rc-patrol.sql' ),
+ array( 'user', 'user_real_name', 'patch-user-realname.sql' ),
+ array( 'user', 'user_token', 'patch-user_token.sql' ),
+);
+
+function add_table( $name, $patch ) {
+ global $wgDatabase;
+ if ( $wgDatabase->tableExists( $name ) ) {
+ echo "...$name table already exists.\n";
+ } else {
+ echo "Creating $name table...";
+ dbsource( "maintenance/archives/$patch", $wgDatabase );
+ echo "ok\n";
+ }
+}
+
+function add_field( $table, $field, $patch ) {
+ global $wgDatabase;
+ if ( $wgDatabase->fieldExists( $table, $field ) ) {
+ echo "...have $field field in $table table.\n";
+ } else {
+ echo "Adding $field field to table $table...";
+ dbsource( "maintenance/archives/$patch" , $wgDatabase );
+ echo "ok\n";
+ }
+}