Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
  • Loading branch information
nickvergessen authored and backportbot[bot] committed Mar 30, 2021
commit e3927afe195dc1fe385baf00439de18096bbcd22
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