diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2018-06-19 10:11:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-19 10:11:09 +0200 |
commit | 7ef722e7a626e07f36b2c2c01d650651b1e4e126 (patch) | |
tree | 6bbff693403e6f394ced4f9eeacb62f6f5c3c86b /core | |
parent | b8492c694480e210aaf2c794ed18adf5a9a751b2 (diff) | |
parent | 82959ca93e229e1f16e1843cd4a2f7523b8ac0bf (diff) | |
download | nextcloud-server-7ef722e7a626e07f36b2c2c01d650651b1e4e126.tar.gz nextcloud-server-7ef722e7a626e07f36b2c2c01d650651b1e4e126.zip |
Merge pull request #9485 from nextcloud/feature/9441/multiple_token_providers
Add new public key token provider (tokens survive password change)
Diffstat (limited to 'core')
-rw-r--r-- | core/Migrations/Version14000Date20180518120534.php | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/core/Migrations/Version14000Date20180518120534.php b/core/Migrations/Version14000Date20180518120534.php new file mode 100644 index 00000000000..a738c6baa7e --- /dev/null +++ b/core/Migrations/Version14000Date20180518120534.php @@ -0,0 +1,54 @@ +<?php +declare(strict_types=1); +/** + * @copyright Copyright (c) 2018 Roeland Jago Douma <roeland@famdouma.nl> + * + * @author Roeland Jago Douma <roeland@famdouma.nl> + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +namespace OC\Core\Migrations; + +use OCP\DB\ISchemaWrapper; +use OCP\Migration\SimpleMigrationStep; +use OCP\Migration\IOutput; + +class Version14000Date20180518120534 extends SimpleMigrationStep { + + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { + /** @var ISchemaWrapper $schema */ + $schema = $schemaClosure(); + + $table = $schema->getTable('authtoken'); + $table->addColumn('private_key', 'text', [ + 'notnull' => false, + ]); + $table->addColumn('public_key', 'text', [ + 'notnull' => false, + ]); + $table->addColumn('version', 'smallint', [ + 'notnull' => true, + 'default' => 1, + 'unsigned' => true, + ]); + $table->addIndex(['uid'], 'authtoken_uid_index'); + $table->addIndex(['version'], 'authtoken_version_index'); + + return $schema; + } +} |