Skip to content

Commit 0432b32

Browse files
Merge pull request #26379 from nextcloud/backport/25924/stable21
[stable21] Only mark migrations as installed after execution
2 parents 3e5fbd4 + e3927af commit 0432b32

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/private/DB/MigrationService.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,6 @@ public function migrateSchemaOnly($to = 'latest') {
453453
$toSchema = $instance->changeSchema($this->output, function () use ($toSchema) {
454454
return $toSchema ?: new SchemaWrapper($this->connection);
455455
}, ['tablePrefix' => $this->connection->getPrefix()]) ?: $toSchema;
456-
457-
$this->markAsExecuted($version);
458456
}
459457

460458
if ($toSchema instanceof SchemaWrapper) {
@@ -466,6 +464,10 @@ public function migrateSchemaOnly($to = 'latest') {
466464
$this->connection->migrateToSchema($targetSchema);
467465
$toSchema->performDropTableCalls();
468466
}
467+
468+
foreach ($toBeExecuted as $version) {
469+
$this->markAsExecuted($version);
470+
}
469471
}
470472

471473
/**

0 commit comments

Comments
 (0)