-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set empty authtoken names to 'none' #30792
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
namespace OC\Migrations; | ||
|
||
use OCP\IDBConnection; | ||
use OCP\Migration\ISqlMigration; | ||
|
||
/** | ||
* Sets empty authtoken names to '(none)' | ||
* https://github.com/owncloud/core/issues/30792 | ||
*/ | ||
class Version20180319102121 implements ISqlMigration { | ||
|
||
public function sql(IDBConnection $connection) { | ||
$q = $connection->getQueryBuilder(); | ||
$q->update('authtoken') | ||
->set('name', '(none)') | ||
->where($q->expr()->eq('name', $q->expr()->literal(''))) | ||
->orWhere($q->expr()->isNull('name')); | ||
|
||
return [$q->getSQL()]; | ||
|
||
} | ||
} |