mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 09:10:12 +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
|
||||
$dbw->upsert(
|
||||
'echo_unread_wikis',
|
||||
$conditions + $values,
|
||||
[ [ 'euw_user', 'euw_wiki' ] ],
|
||||
$values,
|
||||
__METHOD__
|
||||
);
|
||||
$dbw->newInsertQueryBuilder()
|
||||
->insertInto( 'echo_unread_wikis' )
|
||||
->row( $conditions + $values )
|
||||
->onDuplicateKeyUpdate()
|
||||
->uniqueIndexFields( [ 'euw_user', 'euw_wiki' ] )
|
||||
->set( $values )
|
||||
->caller( __METHOD__ )
|
||||
->execute();
|
||||
} else {
|
||||
// No unread notifications, delete the row
|
||||
$dbw->delete(
|
||||
|
|
Loading…
Reference in a new issue