Skip to content

Commit

Permalink
Merge pull request #26379 from nextcloud/backport/25924/stable21
Browse files Browse the repository at this point in the history
[stable21] Only mark migrations as installed after execution
  • Loading branch information
ChristophWurst authored Mar 31, 2021
2 parents 3e5fbd4 + e3927af commit 0432b32
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/private/DB/MigrationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,6 @@ public function migrateSchemaOnly($to = 'latest') {
$toSchema = $instance->changeSchema($this->output, function () use ($toSchema) {
return $toSchema ?: new SchemaWrapper($this->connection);
}, ['tablePrefix' => $this->connection->getPrefix()]) ?: $toSchema;

$this->markAsExecuted($version);
}

if ($toSchema instanceof SchemaWrapper) {
Expand All @@ -466,6 +464,10 @@ public function migrateSchemaOnly($to = 'latest') {
$this->connection->migrateToSchema($targetSchema);
$toSchema->performDropTableCalls();
}

foreach ($toBeExecuted as $version) {
$this->markAsExecuted($version);
}
}

/**
Expand Down

0 comments on commit 0432b32

Please sign in to comment.