diff options
author | Joas Schilling <coding@schilljs.com> | 2019-12-05 14:38:28 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-12-10 11:01:26 +0100 |
commit | 059968e1c705f5b06cd6049f1a7ad05a123f5500 (patch) | |
tree | d777ed35aa8ebba888c6105fe914af298db0ed15 /apps/files/lib | |
parent | b78a141b0b003f6de04f16863e0fb67f28658dab (diff) | |
download | nextcloud-server-059968e1c705f5b06cd6049f1a7ad05a123f5500.tar.gz nextcloud-server-059968e1c705f5b06cd6049f1a7ad05a123f5500.zip |
Pick a shorter name for the transfer ownership table
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files/lib')
-rw-r--r-- | apps/files/lib/Db/TransferOwnershipMapper.php | 2 | ||||
-rw-r--r-- | apps/files/lib/Migration/Version11301Date20191205150729.php (renamed from apps/files/lib/Migration/Version11301Date20191113195931.php) | 21 |
2 files changed, 13 insertions, 10 deletions
diff --git a/apps/files/lib/Db/TransferOwnershipMapper.php b/apps/files/lib/Db/TransferOwnershipMapper.php index f9f4e995feb..fe87fc5e48d 100644 --- a/apps/files/lib/Db/TransferOwnershipMapper.php +++ b/apps/files/lib/Db/TransferOwnershipMapper.php @@ -31,7 +31,7 @@ use OCP\IDBConnection; class TransferOwnershipMapper extends QBMapper { public function __construct(IDBConnection $db) { - parent::__construct($db, 'user_transfer_ownership', TransferOwnership::class); + parent::__construct($db, 'user_transfer_owner', TransferOwnership::class); } public function getById(int $id): TransferOwnership { diff --git a/apps/files/lib/Migration/Version11301Date20191113195931.php b/apps/files/lib/Migration/Version11301Date20191205150729.php index d5c255bb8a3..2ec9bdb4718 100644 --- a/apps/files/lib/Migration/Version11301Date20191113195931.php +++ b/apps/files/lib/Migration/Version11301Date20191205150729.php @@ -1,7 +1,5 @@ <?php - declare(strict_types=1); - /** * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl> * @@ -24,15 +22,14 @@ declare(strict_types=1); * */ - namespace OCA\Files\Migration; use Closure; use OCP\DB\ISchemaWrapper; -use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; -class Version11301Date20191113195931 extends SimpleMigrationStep { +class Version11301Date20191205150729 extends SimpleMigrationStep { /** * @param IOutput $output @@ -44,11 +41,12 @@ class Version11301Date20191113195931 extends SimpleMigrationStep { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); - $table = $schema->createTable('user_transfer_ownership'); - $table->addColumn('id', 'integer', [ + $table = $schema->createTable('user_transfer_owner'); + $table->addColumn('id', 'bigint', [ 'autoincrement' => true, 'notnull' => true, - 'length' => 4, + 'length' => 20, + 'unsigned' => true, ]); $table->addColumn('source_user', 'string', [ 'notnull' => true, @@ -68,7 +66,12 @@ class Version11301Date20191113195931 extends SimpleMigrationStep { ]); $table->setPrimaryKey(['id']); + // Quite radical, we just assume no one updates cross beta with a pending request. + // Do not try this at home + if ($schema->hasTable('user_transfer_ownership')) { + $schema->dropTable('user_transfer_ownership'); + } + return $schema; } - } |