diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2021-02-16 09:11:10 +0100 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2021-02-16 11:38:43 +0100 |
commit | 2ea3cb7c93efdfde1e161c162063213097f7614f (patch) | |
tree | 13af517011c59bcf6c178171699d86552d1dccea /apps/dav/lib/Migration | |
parent | a649dff1795f6df7e70742bea5e45265903476d4 (diff) | |
download | nextcloud-server-2ea3cb7c93efdfde1e161c162063213097f7614f.tar.gz nextcloud-server-2ea3cb7c93efdfde1e161c162063213097f7614f.zip |
Drop redundant indes
Those indexes are already covered by others. So those can just be used.
THose extra indexes just take up space.
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/dav/lib/Migration')
-rw-r--r-- | apps/dav/lib/Migration/Version1011Date20190806104428.php | 1 | ||||
-rw-r--r-- | apps/dav/lib/Migration/Version1017Date20210216083742.php | 55 |
2 files changed, 55 insertions, 1 deletions
diff --git a/apps/dav/lib/Migration/Version1011Date20190806104428.php b/apps/dav/lib/Migration/Version1011Date20190806104428.php index cf3edb4b695..c5b6fc5b45f 100644 --- a/apps/dav/lib/Migration/Version1011Date20190806104428.php +++ b/apps/dav/lib/Migration/Version1011Date20190806104428.php @@ -71,7 +71,6 @@ class Version1011Date20190806104428 extends SimpleMigrationStep { $table->setPrimaryKey(['id']); $table->addUniqueIndex(['owner_id', 'proxy_id', 'permissions'], 'dav_cal_proxy_uidx'); - $table->addIndex(['owner_id'], 'dav_cal_proxy_ioid'); $table->addIndex(['proxy_id'], 'dav_cal_proxy_ipid'); return $schema; diff --git a/apps/dav/lib/Migration/Version1017Date20210216083742.php b/apps/dav/lib/Migration/Version1017Date20210216083742.php new file mode 100644 index 00000000000..20e6ab3bfe8 --- /dev/null +++ b/apps/dav/lib/Migration/Version1017Date20210216083742.php @@ -0,0 +1,55 @@ +<?php + +declare(strict_types=1); + +/** + * @copyright Copyright (c) 2021 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 OCA\DAV\Migration; + +use Closure; +use OCP\DB\ISchemaWrapper; +use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; + +/** + * Auto-generated migration step: Please modify to your needs! + */ +class Version1017Date20210216083742 extends SimpleMigrationStep { + /** + * @param IOutput $output + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` + * @param array $options + * @return null|ISchemaWrapper + */ + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { + /** @var ISchemaWrapper $schema */ + $schema = $schemaClosure(); + + $table = $schema->getTable('dav_cal_proxy'); + if ($table->hasIndex('dav_cal_proxy_ioid')) { + $table->dropIndex('dav_cal_proxy_ioid'); + } + + return $schema; + } +} |