Skip to content

Commit

Permalink
Merge pull request #3694 from nextcloud/fix/image-recraetion-hotfix
Browse files Browse the repository at this point in the history
Avoid expensive index recreation
  • Loading branch information
dartcafe authored Sep 6, 2024
2 parents b84fd23 + f33f43d commit 057d667
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
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

0 comments on commit 057d667

Please sign in to comment.