Manual:populateParentId.php

From Linux Web Expert

Revision as of 04:43, 6 December 2023 by imported>FuzzyBot (Updating to match new version of source page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<td class="mw-version-versionbox" title="<translate nowrap> MediaWiki <tvar name=1>1.35</tvar> is unsupported version</translate>">
<translate> ≤</translate> 1.35
<translate> MediaWiki version:</translate>

詳細

populateParentId.php is a maintenance script to make the required database updates for revision.rev_parent_id to be of any use.

This script was removed for MediaWiki version 1.36 and later.

This script runs by default when you run Manual:update.php .

歴史

The first versions of populateParentId.php sorted the rev_parent_id linked list (at least with regard to those rows that had a null rev_parent_id) strictly by revision.rev_id. It assumed that the previous revision of the title was the original previous revision of the title when the edit was made. This behavior was changed by Aaron Schulz because it could result in loops.

The way it works now is that, after populateParentId.php selects the rows with null rev_parent_id, when it is dealing with a particular revision, first it checks for rows with the same revision.rev_timestamp as that revision, that have with a smaller rev_id than that revision. The highest ID "wins". This avoids loops as the timestamp can only decrease and never loops with IDs (from parent to parent). If there are no rows with the same timestamp, then it uses the highest ID with a lower timestamp.

オプション

このスクリプトにはオプションはありません。

使用法

php maintenance/populateParentId.php
Terminal
The script returns "rev_parent_id column of revision table already populated", run the script with the --force argument.

See also