diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 4470791109..42c3de3ea1 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -453,8 +453,6 @@ class MigrationService { $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) { @@ -466,6 +464,10 @@ class MigrationService { $this->connection->migrateToSchema($targetSchema); $toSchema->performDropTableCalls(); } + + foreach ($toBeExecuted as $version) { + $this->markAsExecuted($version); + } } /**