Skip to content

Commit

Permalink
Merge pull request #25924 from nextcloud/bugfix/noid/only-mark-migrat…
Browse files Browse the repository at this point in the history
…ions-as-installed-after-executing-them-in-case-the-developer-broke-them

Only mark migrations as installed after execution
  • Loading branch information
MorrisJobke authored Mar 17, 2021
2 parents f56e5bb + 1e5fea0 commit 459e0b3
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 459e0b3

Please sign in to comment.