diff options
author | Joas Schilling <coding@schilljs.com> | 2021-03-04 08:49:42 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2021-03-04 08:49:42 +0100 |
commit | 1e5fea0460a3e7de78b141acaec49a4cb750c4d7 (patch) | |
tree | 8c6c5f45913808a916f59f26eefb3b59e00fd8df /lib/private/DB | |
parent | 9b573c6bd5df281833f455c9770826bc74283d5d (diff) | |
download | nextcloud-server-1e5fea0460a3e7de78b141acaec49a4cb750c4d7.tar.gz nextcloud-server-1e5fea0460a3e7de78b141acaec49a4cb750c4d7.zip |
Only mark migrations as installed after execution
The problem is that if a developer creates a structural error in their migration file,
they will already be marked as executed and an not be rerun.
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/DB')
-rw-r--r-- | lib/private/DB/MigrationService.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 8bbd077d85d..42f3b7de6a8 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); + } } /** |