[DATABASE] Use "<>" as an SQL non-equality sign in more cases

A follow-up to commit 644b417f6c
This commit is contained in:
Alexei Sorokin
2020-06-08 18:31:22 +03:00
committed by Diogo Peralta Cordeiro
parent 9ac632ca2d
commit 434f07430d
12 changed files with 384 additions and 320 deletions

View File

@@ -362,7 +362,8 @@ function initNoticeReshare()
$notice = new Notice();
$notice->whereAdd('repeat_of is not null');
$notice->whereAdd('(verb != "'.ActivityVerb::SHARE.'" OR object_type != "'.ActivityObject::ACTIVITY.'")');
$notice->whereAdd('(verb <> "' . ActivityVerb::SHARE
. '" OR object_type <> "' . ActivityObject::ACTIVITY . '")');
if ($notice->find()) {
while ($notice->fetch()) {
@@ -580,7 +581,7 @@ function deleteMissingLocalFileThumbnails()
printfnq("Removing all local File_thumbnail entries without existing files...");
$thumbs = new File_thumbnail();
$thumbs->whereAdd("filename IS NOT NULL AND filename != ''");
$thumbs->whereAdd("filename IS NOT NULL AND filename <> ''");
// Checking if there were any File_thumbnail entries without filename
if ($thumbs->find()) {
while ($thumbs->fetch()) {
@@ -603,7 +604,7 @@ function setFilehashOnLocalFiles()
printfnq('Ensuring all local files have the filehash field set...');
$file = new File();
$file->whereAdd("filename IS NOT NULL AND filename != ''"); // local files
$file->whereAdd("filename IS NOT NULL AND filename <> ''"); // local files
$file->whereAdd('filehash IS NULL', 'AND'); // without filehash value
if ($file->find()) {