Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid expensive index recreation #3694

Merged
merged 5 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
-->
# Changelog
##
## [7.2.2] - 2024-09-06
### Fix
- fix watcher in situations it may fail on pollId 0
- fix failing routes on tokens with trailing spaces
- Removed index removal from the pre-migration repair steps

## [7.2.1] - 2024-08-22
### Fix
- Fix deleted user when email share registers
Expand Down
1 change: 0 additions & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
<repair-steps>
<pre-migration>
<step>OCA\Polls\Migration\RepairSteps\RemoveObsoleteMigrations</step>
<step>OCA\Polls\Migration\RepairSteps\RemoveIndices</step>
</pre-migration>
<post-migration>
<step>OCA\Polls\Migration\RepairSteps\DropOrphanedTables</step>
Expand Down
12 changes: 9 additions & 3 deletions lib/Command/Db/Rebuild.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2021 Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
/**
* SPDX-FileCopyrightText: 2021 Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Polls\Command\Db;
Expand All @@ -23,6 +23,12 @@ class Rebuild extends Command {
protected array $operationHints = [
'All polls tables will get checked against the current schema.',
'NO data migration will be executed, so make sure you have a backup of your database.',
'',
'*****************************',
'** Please understand **',
'*****************************',
'The process will also recreate all indices and foreign key constraints.',
'This can lead to a database performance impact on the app after the recreation is done.',
];

public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion lib/Db/IndexManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function createForeignKeyConstraints(): array {
/**
* add an on delete fk contraint
*
* @param string $parentTableName name of reffered table
* @param string $parentTableName name of referred table
* @param string $childTableName name of referring table
* @return string log message
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/PreferencesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct(
public function load(): void {
try {
$this->preferences = $this->preferencesMapper->find($this->userSession->getCurrentUserId());
} catch (Exception $e) {
} catch (Exception $e) {
$this->preferences = new Preferences;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/WatchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
*/
public function watchUpdates(int $pollId, ?int $offset = null): array {

if($pollId !== 0) {
if ($pollId !== 0) {
$this->pollMapper->find($pollId)->request(Poll::PERMISSION_POLL_VIEW);
}

Expand Down