Skip to content

Commit

Permalink
Set empty authtoken names to 'none' #30792
Browse files Browse the repository at this point in the history
  • Loading branch information
IljaN committed Mar 19, 2018
1 parent 15ddbfa commit ce25085
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions core/Migrations/Version20180319102121.php
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->automaticTablePrefix(true);

$q->update('authtoken')
->set('name', '(none)')
->where("name = ''")
->orWhere('name IS NULL')
->execute();
}
}

0 comments on commit ce25085

Please sign in to comment.