addDescription( 'Script to convert old, TOTP specific, column values to new structure' ); $this->requireExtension( 'OATHAuth' ); } /** * @throws ConfigException */ public function execute() { global $wgOATHAuthDatabase; $lb = MediaWikiServices::getInstance()->getDBLoadBalancerFactory() ->getMainLB( $wgOATHAuthDatabase ); $dbw = $lb->getConnectionRef( DB_PRIMARY, [], $wgOATHAuthDatabase ); if ( !UpdateTables::convertToGenericFields( $dbw ) ) { $this->fatalError( "Failed to update the data structure rows.\n" ); } $this->output( "Done.\n" ); } } $maintClass = UpdateDatabaseValueFormat::class; require_once RUN_MAINTENANCE_IF_MAIN;