Manual:migrateComments.php
| MediaWiki バージョン: | 1.30 – 1.39 |
| MediaWiki ファイル: migrateComments.php | |
|---|---|
| 場所: | maintenance/ |
| ソース コード: | master • 1.44.2 • 1.43.5 • 1.39.15 |
| クラス: | MigrateComments |
詳細
migrateComments.php is a maintenance script that migrates comments from pre-1.30 columns to the 'comment' table.
$wgCommentTableSchemaMigrationStage needs to be set to MIGRATION_WRITE_NEW or MIGRATION_NEW for the script to do the migration.
While migrating comments in a table, the script assumes any rows with the ID field non-zero (e.g. ar_comment_id non-zero) have already been migrated.
Also it assumes the new field name is the same as the old with '_id' appended. It blanks the old fields while migrating.
The script migrates the following columns:
| テーブル | Old column | New column |
|---|---|---|
| revision | rev_comment | revcomment_comment_id |
| archive | ar_comment | ar_comment_id |
| ipblocks | ipb_reason | ipb_reason_id |
| image | img_description | imgcomment_description_id |
| oldimage | oi_description | oi_description_id |
| filearchive | fa_deleted_reason | fa_deleted_reason_id |
| filearchive | fa_description | fa_description_id |
| recentchanges | rc_comment | rc_comment_id |
| logging | log_comment | log_comment_id |
| protected_titles | pt_reason | pt_reason_id |
The comments are finally stored in the column comment_text in the comment table.
To improve performance during the run-time of this script, for the tables revision and image, a temporary table named revision_comment_temp and image_comment_temp is being used during the migration.
These two tables will be merged with the tables revision and images again in the future.
使用法
php migrateComments.php