Merge pull request #25924 from nextcloud/bugfix/noid/only-mark-migrations-as-installed-after-executing-them-in-case-the-developer-broke-them

Only mark migrations as installed after execution
This commit is contained in:
Morris Jobke 2021-03-17 20:29:28 +01:00 committed by GitHub
commit 459e0b311b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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);
}
}
/**