Migrate revision_comment_temp to rev_comment_id

Bug: T299954
Change-Id: If3224c73645d5ce5542228a6cee2848e98a9efee
This commit is contained in:
Alexander Vorwerk 2023-05-27 23:36:26 +02:00 committed by Zabe
parent e95c2ca5b7
commit ef8d45fd12
5 changed files with 6 additions and 13 deletions

View file

@ -57,7 +57,7 @@ class CommentStore extends CommentStoreBase {
'pk' => 'revcomment_rev',
'field' => 'revcomment_comment_id',
'joinPK' => 'rev_id',
'stage' => MIGRATION_OLD,
'stage' => SCHEMA_COMPAT_WRITE_BOTH | SCHEMA_COMPAT_READ_NEW,
'deprecatedIn' => null,
],
];

View file

@ -145,6 +145,7 @@ class MysqlUpdater extends DatabaseUpdater {
// 1.41
[ 'addField', 'user', 'user_is_temp', 'patch-user-user_is_temp.sql' ],
[ 'runMaintenance', MigrateRevisionCommentTemp::class, 'maintenance/migrateRevisionCommentTemp.php' ],
];
}

View file

@ -450,6 +450,7 @@ class PostgresUpdater extends DatabaseUpdater {
// 1.41
[ 'addField', 'user', 'user_is_temp', 'patch-user-user_is_temp.sql' ],
[ 'runMaintenance', MigrateRevisionCommentTemp::class, 'maintenance/migrateRevisionCommentTemp.php' ],
];
}

View file

@ -126,6 +126,7 @@ class SqliteUpdater extends DatabaseUpdater {
// 1.41
[ 'addField', 'user', 'user_is_temp', 'patch-user-user_is_temp.sql' ],
[ 'runMaintenance', MigrateRevisionCommentTemp::class, 'maintenance/migrateRevisionCommentTemp.php' ],
];
}

View file

@ -144,7 +144,6 @@ class RevisionQueryInfoTest extends MediaWikiIntegrationTestCase {
'revision',
'page',
'user',
'temp_rev_comment' => 'revision_comment_temp',
'actor_rev_user' => 'actor',
'comment_rev_comment' => 'comment',
],
@ -161,11 +160,7 @@ class RevisionQueryInfoTest extends MediaWikiIntegrationTestCase {
'LEFT JOIN',
[ 'actor_rev_user.actor_user != 0', 'user_id = actor_rev_user.actor_user' ],
],
'comment_rev_comment' => [
'JOIN',
'comment_rev_comment.comment_id = temp_rev_comment.revcomment_comment_id',
],
'temp_rev_comment' => [ 'JOIN', 'temp_rev_comment.revcomment_rev = rev_id' ],
'comment_rev_comment' => [ 'JOIN', 'comment_rev_comment.comment_id = rev_comment_id' ],
'actor_rev_user' => [ 'JOIN', 'actor_rev_user.actor_id = rev_actor' ]
],
]
@ -176,7 +171,6 @@ class RevisionQueryInfoTest extends MediaWikiIntegrationTestCase {
[
'tables' => [
'revision',
'temp_rev_comment' => 'revision_comment_temp',
'actor_rev_user' => 'actor',
'comment_rev_comment' => 'comment',
],
@ -186,11 +180,7 @@ class RevisionQueryInfoTest extends MediaWikiIntegrationTestCase {
$this->getCommentQueryFields( 'rev' )
),
'joins' => [
'comment_rev_comment' => [
'JOIN',
'comment_rev_comment.comment_id = temp_rev_comment.revcomment_comment_id',
],
'temp_rev_comment' => [ 'JOIN', 'temp_rev_comment.revcomment_rev = rev_id' ],
'comment_rev_comment' => [ 'JOIN', 'comment_rev_comment.comment_id = rev_comment_id' ],
'actor_rev_user' => [ 'JOIN', 'actor_rev_user.actor_id = rev_actor' ],
]
]