Help:Maintenance script populateHashField.php

The "populateHashField.php" maintenance script allows mass conversions of database field "smw_hash" in the "smw_objects_ids" database table when initially upgrading to or later and only has to be run once. As soon as you have successfully upgraded it will no longer be necessary to use it. The maintenance script was introduced in .CiteRef::gh:smw:3611

Rationale
During an upgrade to and later some elements of the database table may require to be updated and pending its importance it has to happen before any access to that table occurs. However due to the sheer size of the "smw_objects_ids" database table the update of database field "smw_hash" could hog resources making or alternatively  run for a considerable time.

To mitigate this the initial update of database field "smw_hash"CiteRef::gh:smw:3080 which only happens once when initially switching to and later will be executed with a set threshold of 200,000 database table rows (meaning missing converted rows) for the conversion during the normal usage of "update.php" or alternatively "setupStore.php" to allow system administrators to quickly run the upgrade. Hereafter the process is postponed and the status " " is saved to the "populate.smw_hash_field_complete" field in the setup information file ".smw.json". At the same time a message as described on the help page on upgrading will start to appear on every wiki page to remind users and system administrators that the upgrade has not finished yet and requires immediate action, i.e. running this "populateHashField.php" upgrade script to complete populating of database field "smw_hash" in the "smw_objects_ids" database table.

Once "populateHashField.php" was run as a follow up to "update.php" or alternatively "setupStore.php" the status of the "populate.smw_hash_field_complete" field is being updated to " " in the setup information file ".smw.json". Thus the upgrade is completed and the error message will no longer appear on wiki pages.

Parameters
Maintenance scripts provide generic maintenance parameters, script dependent parameters and depending on the maintenance script script specific parameters which are described on this page if provided.

Example
Checking smw_hash field consistency ...  ... all rows populated ...
 * The following command populates the "smw_hash" field in the "smw_objects_ids" database table

... writing the upgrade file ...   ... done.