Skip to content

Commit 52f8701

Browse files
authored
Merge pull request #4288 from nextcloud/fix/avoid-old-migration
Replace possibly incorrect migrations by dummy migration to avoid execution
2 parents 361d7dc + 0548360 commit 52f8701

36 files changed

Lines changed: 401 additions & 72 deletions

appinfo/info.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
<job>OCA\Polls\Cron\JanitorCron</job>
3333
<job>OCA\Polls\Cron\AutoReminderCron</job>
3434
</background-jobs>
35+
<repair-steps>
36+
<post-migration>
37+
<step>OCA\Polls\Migration\RepairSteps\UpdateHashes</step>
38+
</post-migration>
39+
</repair-steps>
3540
<commands>
3641
<command>OCA\Polls\Command\Db\CleanMigrations</command>
3742
<command>OCA\Polls\Command\Db\CreateIndices</command>

lib/Command/Db/CleanMigrations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use Doctrine\DBAL\Schema\Schema;
1212
use OCA\Polls\Command\Command;
13-
use OCA\Polls\Db\V3\TableManager;
13+
use OCA\Polls\Db\V4\TableManager;
1414
use OCP\IDBConnection;
1515

1616
/**

lib/Command/Db/CreateIndices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use Doctrine\DBAL\Schema\Schema;
1212
use OCA\Polls\Command\Command;
13-
use OCA\Polls\Db\V3\IndexManager;
13+
use OCA\Polls\Db\V4\IndexManager;
1414
use OCP\IDBConnection;
1515

1616
/**

lib/Command/Db/FixDB.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use Doctrine\DBAL\Schema\Schema;
1212
use OCA\Polls\Command\Command;
13-
use OCA\Polls\Db\V3\TableManager;
13+
use OCA\Polls\Db\V4\TableManager;
1414
use OCP\IDBConnection;
1515

1616
/**

lib/Command/Db/Purge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace OCA\Polls\Command\Db;
1010

1111
use OCA\Polls\Command\Command;
12-
use OCA\Polls\Db\V3\TableManager;
12+
use OCA\Polls\Db\V4\TableManager;
1313
use OCP\IDBConnection;
1414

1515
/**

lib/Command/Db/Rebuild.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
namespace OCA\Polls\Command\Db;
1010

1111
use Doctrine\DBAL\Schema\Schema;
12-
use OCA\Polls\Db\V3\TableManager;
13-
use OCA\Polls\Db\V3\IndexManager;
12+
use OCA\Polls\Db\V4\TableManager;
13+
use OCA\Polls\Db\V4\IndexManager;
1414
use OCA\Polls\Command\Command;
1515
use OCP\IDBConnection;
1616

@@ -68,7 +68,7 @@ protected function runCommands(): int {
6868

6969
$this->printComment('Step 5. Validate and fix records');
7070
$this->removeOrphaned();
71-
$this->migrateOptionsToHash();
71+
$this->updateHashes();
7272
$this->deleteAllDuplicates();
7373
$this->setLastInteraction();
7474

@@ -123,9 +123,9 @@ private function createOrUpdateSchema(): void {
123123
/**
124124
* Add or update hash for votes and options
125125
*/
126-
private function migrateOptionsToHash(): void {
126+
private function updateHashes(): void {
127127
$this->printComment(' - Add or update hashes');
128-
$messages = $this->tableManager->migrateOptionsToHash();
128+
$messages = $this->tableManager->updateHashes();
129129
$this->printInfo($messages, ' ');
130130
}
131131

lib/Command/Db/RemoveFKConstraints.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use Doctrine\DBAL\Schema\Schema;
1212
use OCA\Polls\Command\Command;
13-
use OCA\Polls\Db\V3\IndexManager;
13+
use OCA\Polls\Db\V4\IndexManager;
1414
use OCP\IDBConnection;
1515

1616
/**

lib/Command/Db/RemoveOptionalIndices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use Doctrine\DBAL\Schema\Schema;
1212
use OCA\Polls\Command\Command;
13-
use OCA\Polls\Db\V3\IndexManager;
13+
use OCA\Polls\Db\V4\IndexManager;
1414
use OCP\IDBConnection;
1515

1616
/**

lib/Command/Db/RemoveUniqueIndices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
use Doctrine\DBAL\Schema\Schema;
1212
use OCA\Polls\Command\Command;
13-
use OCA\Polls\Db\V3\IndexManager;
13+
use OCA\Polls\Db\V4\IndexManager;
1414
use OCP\IDBConnection;
1515

1616
/**

lib/Command/Db/ResetWatch.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
use Doctrine\DBAL\Schema\Schema;
1212
use OCA\Polls\Command\Command;
13-
use OCA\Polls\Db\V3\IndexManager;
14-
use OCA\Polls\Db\V3\TableManager;
13+
use OCA\Polls\Db\V4\IndexManager;
14+
use OCA\Polls\Db\V4\TableManager;
1515
use OCA\Polls\Db\Watch;
16-
use OCA\Polls\Migration\V3\TableSchema;
16+
use OCA\Polls\Migration\V4\TableSchema;
1717
use OCP\IDBConnection;
1818

1919
/**

0 commit comments

Comments
 (0)