Merge pull request #5612 from mintsoft/index_cleanup
Cleaning up unused indicies
This commit is contained in:
@@ -271,7 +271,7 @@ class Version1000Date20200306161713 extends SimpleMigrationStep {
|
|||||||
]);
|
]);
|
||||||
$table->setPrimaryKey(['id']);
|
$table->setPrimaryKey(['id']);
|
||||||
$table->addIndex(['participant'], 'deck_assigned_users_idx_p');
|
$table->addIndex(['participant'], 'deck_assigned_users_idx_p');
|
||||||
$table->addIndex(['card_id'], 'deck_assigned_users_idx_c');
|
//$table->addIndex(['card_id'], 'deck_assigned_users_idx_c');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$schema->hasTable('deck_board_acl')) {
|
if (!$schema->hasTable('deck_board_acl')) {
|
||||||
@@ -307,7 +307,7 @@ class Version1000Date20200306161713 extends SimpleMigrationStep {
|
|||||||
]);
|
]);
|
||||||
$table->setPrimaryKey(['id']);
|
$table->setPrimaryKey(['id']);
|
||||||
$table->addUniqueIndex(['board_id', 'type', 'participant'], 'deck_board_acl_uq_i');
|
$table->addUniqueIndex(['board_id', 'type', 'participant'], 'deck_board_acl_uq_i');
|
||||||
$table->addIndex(['board_id'], 'deck_board_acl_idx_i');
|
//$table->addIndex(['board_id'], 'deck_board_acl_idx_i');
|
||||||
}
|
}
|
||||||
return $schema;
|
return $schema;
|
||||||
}
|
}
|
||||||
|
|||||||
35
lib/Migration/Version11000Date20240222115515.php
Normal file
35
lib/Migration/Version11000Date20240222115515.php
Normal file
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user