-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5612 from mintsoft/index_cleanup
Cleaning up unused indicies
- Loading branch information
Showing
2 changed files
with
37 additions
and
2 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
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,35 @@ | ||
<?php | ||
/** | ||
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
|
||
namespace OCA\Deck\Migration; | ||
|
||
use Closure; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\Migration\IOutput; | ||
use OCP\Migration\SimpleMigrationStep; | ||
|
||
class Version11000Date20240222115515 extends SimpleMigrationStep { | ||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
$schema = $schemaClosure(); | ||
$returnValue = null; | ||
|
||
$assignedUsersTable = $schema->getTable('deck_assigned_users'); | ||
if($assignedUsersTable->hasIndex('deck_assigned_users_idx_c')) { | ||
$assignedUsersTable->dropIndex('deck_assigned_users_idx_c'); | ||
$returnValue = $schema; | ||
} | ||
|
||
$boardAclTable = $schema->getTable('deck_board_acl'); | ||
if($boardAclTable->hasIndex('deck_board_acl_idx_i')) { | ||
$boardAclTable->dropIndex('deck_board_acl_idx_i'); | ||
$returnValue = $schema; | ||
} | ||
return $returnValue; | ||
} | ||
} |