Skip to content

Commit 8b9b7c7

Browse files
authored
Merge pull request #4160 from nextcloud/hotfix/avoid-broken-install-8.1.0
Hotfix to avoid broken install of v8.1.0
2 parents 54d11a4 + 8aebc8d commit 8b9b7c7

5 files changed

Lines changed: 19 additions & 10 deletions

File tree

appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<name>Polls</name>
55
<summary>A polls app, similar to Doodle/DuD-Poll with the possibility to restrict access.</summary>
66
<description>A polls app, similar to Doodle/DuD-Poll with the possibility to restrict access (members, certain groups/users, hidden and public).</description>
7-
<version>8.1.0</version>
7+
<version>8.1.2</version>
88
<licence>agpl</licence>
99
<author>Vinzenz Rosenkranz</author>
1010
<author>René Gieling</author>

lib/Migration/RepairSteps/DeleteInvalidRecords.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespace OCA\Polls\Migration\RepairSteps;
1111

1212
use Doctrine\DBAL\Schema\Schema;
13+
use Exception;
1314
use OCA\Polls\Db\Poll;
1415
use OCA\Polls\Db\TableManager;
1516
use OCA\Polls\Db\WatchMapper;
@@ -38,15 +39,18 @@ public function getName():string {
3839

3940
public function run(IOutput $output):void {
4041
if ($this->connection->tableExists(Poll::TABLE)) {
41-
$this->schema = $this->connection->createSchema();
42-
$this->tableManager->setSchema($this->schema);
42+
try {
43+
$this->schema = $this->connection->createSchema();
44+
$this->tableManager->setSchema($this->schema);
4345

44-
$this->tableManager->removeOrphaned();
45-
$this->tableManager->deleteAllDuplicates();
46+
$this->tableManager->removeOrphaned();
47+
$this->tableManager->deleteAllDuplicates();
4648

49+
$this->watchMapper->deleteOldEntries(time());
50+
} catch (Exception $e) {
51+
// Simply skip repair, if it breaks and rely on the next run
52+
}
4753
$this->connection->migrateToSchema($this->schema);
48-
49-
$this->watchMapper->deleteOldEntries(time());
5054
}
5155
}
5256
}

lib/Migration/TableSchema.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
*/
3030

3131
abstract class TableSchema {
32+
// deprecated since 8.1.0, but keeb these constants to prevent broken updates
33+
// from a version prior to 8.1.0; Fix was implemented with v8.1.2
34+
public const FK_PARENT_TABLE = Poll::TABLE;
35+
public const FK_CHILD_TABLES = [];
36+
public const FK_OTHER_TABLES = [];
3237

3338
/**
3439
* define all foreign key indices

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "polls",
3-
"version": "8.1.0",
3+
"version": "8.1.2",
44
"private": true,
55
"description": "Polls app for nextcloud",
66
"homepage": "https://github.com/nextcloud/polls#readme",

0 commit comments

Comments
 (0)