mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-30 18:45:07 +00:00
Merge "Migrate to IDatabase::newInsertQueryBuilder for upsert"
This commit is contained in:
commit
f13b8f2ed1
|
@ -140,13 +140,14 @@ class UnreadWikis {
|
||||||
];
|
];
|
||||||
|
|
||||||
// when there is unread alert(s) and/or message(s), upsert the row
|
// when there is unread alert(s) and/or message(s), upsert the row
|
||||||
$dbw->upsert(
|
$dbw->newInsertQueryBuilder()
|
||||||
'echo_unread_wikis',
|
->insertInto( 'echo_unread_wikis' )
|
||||||
$conditions + $values,
|
->row( $conditions + $values )
|
||||||
[ [ 'euw_user', 'euw_wiki' ] ],
|
->onDuplicateKeyUpdate()
|
||||||
$values,
|
->uniqueIndexFields( [ 'euw_user', 'euw_wiki' ] )
|
||||||
__METHOD__
|
->set( $values )
|
||||||
);
|
->caller( __METHOD__ )
|
||||||
|
->execute();
|
||||||
} else {
|
} else {
|
||||||
// No unread notifications, delete the row
|
// No unread notifications, delete the row
|
||||||
$dbw->delete(
|
$dbw->delete(
|
||||||
|
|
Loading…
Reference in a new issue