Skip to content

Commit f4b6cea

Browse files
committed
Cleaning up unused indicies, fixes #5520
Signed-off-by: Rob Emery <git@mintsoft.net>
1 parent f739dda commit f4b6cea

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
/**
3+
* @copyright Copyright (c) 2022, chandi Langecker (git@chandi.it)
4+
*
5+
* @license GNU AGPL version 3 or any later version
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as
9+
* published by the Free Software Foundation, either version 3 of the
10+
* License, or (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*
20+
*/
21+
22+
declare(strict_types=1);
23+
24+
25+
namespace OCA\Deck\Migration;
26+
27+
use Closure;
28+
use OCP\DB\ISchemaWrapper;
29+
use OCP\DB\Types;
30+
use OCP\Migration\IOutput;
31+
use OCP\Migration\SimpleMigrationStep;
32+
33+
class Version11000Date20240222115515 extends SimpleMigrationStep {
34+
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
35+
$schema = $schemaClosure();
36+
37+
$assigned_users_table = $schema->getTable('deck_assigned_users');
38+
if($assigned_users_table->hasIndex('deck_assigned_users_idx_c')) {
39+
$assigned_users_table->dropIndex('deck_assigned_users_idx_c');
40+
}
41+
42+
$board_acl_table = $schema->getTable('deck_board_acl');
43+
if($board_acl_table->hasIndex('deck_board_acl_idx_i')) {
44+
$board_acl_table->dropIndex('deck_board_acl_idx_i');
45+
}
46+
return $schema;
47+
}
48+
}

0 commit comments

Comments
 (0)