diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-03-24 11:12:12 +0100 |
---|---|---|
committer | Vincent Petry (Rebase PR Action) <PVince81@users.noreply.github.com> | 2022-03-24 20:35:02 +0000 |
commit | 7dc3eb1e9e9a2cf6b52dc17986b4bbca395f0998 (patch) | |
tree | 4c3d21f90d7caa4aca1a7c1abb7d4d7444c34dec /apps/user_ldap/lib/Migration | |
parent | a7e778b57fb81c8e62d093ece7f0689d34db4c45 (diff) | |
download | nextcloud-server-7dc3eb1e9e9a2cf6b52dc17986b4bbca395f0998.tar.gz nextcloud-server-7dc3eb1e9e9a2cf6b52dc17986b4bbca395f0998.zip |
Use getLengthExpression to measure field length instead of like
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'apps/user_ldap/lib/Migration')
-rw-r--r-- | apps/user_ldap/lib/Migration/Version1120Date20210917155206.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/user_ldap/lib/Migration/Version1120Date20210917155206.php b/apps/user_ldap/lib/Migration/Version1120Date20210917155206.php index d2b440c4dfe..87a8f07fbe1 100644 --- a/apps/user_ldap/lib/Migration/Version1120Date20210917155206.php +++ b/apps/user_ldap/lib/Migration/Version1120Date20210917155206.php @@ -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; } |