mirror of
https://github.com/nextcloud/server.git
synced 2026-05-25 18:52:53 -04:00
Use getLengthExpression to measure field length instead of like
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
64d4790864
commit
774bb066d9
1 changed files with 2 additions and 1 deletions
|
|
@ -127,9 +127,10 @@ class Version1120Date20210917155206 extends SimpleMigrationStep {
|
|||
|
||||
protected function getSelectQuery(string $table): IQueryBuilder {
|
||||
$qb = $this->dbc->getQueryBuilder();
|
||||
$lengthExpr = $this->dbc->getDatabasePlatform()->getLengthExpression('owncloud_name');
|
||||
$qb->select('owncloud_name', 'directory_uuid')
|
||||
->from($table)
|
||||
->where($qb->expr()->like('owncloud_name', $qb->createNamedParameter(str_repeat('_', 65) . '%'), Types::STRING));
|
||||
->where($qb->expr()->gt($qb->createFunction($lengthExpr), '64', IQueryBuilder::PARAM_INT));
|
||||
return $qb;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue