db: use 1 for literals

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/653/head
Varun Patil 2023-04-24 23:03:33 -07:00
parent 5eb6115680
commit 0718a03ee0
4 changed files with 4 additions and 4 deletions

View File

@ -258,7 +258,7 @@ class FaceRecognitionBackend extends Backend
// By default it shows the people who were not hidden
if (!$show_hidden) {
$query->andWhere($query->expr()->eq('frp.is_visible', $query->expr()->literal(true, \PDO::PARAM_BOOL)));
$query->andWhere($query->expr()->eq('frp.is_visible', $query->expr()->literal(1)));
}
// ORDER by number of faces in cluster and id for response stability.

View File

@ -33,7 +33,7 @@ trait TimelineQueryFilters
public function transformVideoFilter(IQueryBuilder &$query, bool $aggregate)
{
$query->andWhere($query->expr()->eq('m.isvideo', $query->expr()->literal(true, \PDO::PARAM_BOOL)));
$query->andWhere($query->expr()->eq('m.isvideo', $query->expr()->literal(1)));
}
public function transformLimit(IQueryBuilder &$query, bool $aggregate, int $limit)

View File

@ -80,7 +80,7 @@ trait TimelineWriteOrphans
$query = $this->connection->getQueryBuilder();
$query->select(...$fields)
->from('memories')
->where($query->expr()->eq('orphan', $query->expr()->literal(true, IQueryBuilder::PARAM_BOOL)))
->where($query->expr()->eq('orphan', $query->expr()->literal(1)))
->setMaxResults($count)
;

View File

@ -155,7 +155,7 @@ class Index
$query->leftJoin('f', $table, $alias, $query->expr()->andX(
$query->expr()->eq('f.fileid', "{$alias}.fileid"),
$query->expr()->eq('f.mtime', "{$alias}.mtime"),
$query->expr()->eq("{$alias}.orphan", $query->expr()->literal(false, IQueryBuilder::PARAM_BOOL))
$query->expr()->eq("{$alias}.orphan", $query->expr()->literal(0))
));
$query->andWhere($query->expr()->isNull("{$alias}.fileid"));