Skip to content
Snippets Groups Projects
Commit e3927afe authored by Joas Schilling's avatar Joas Schilling Committed by backportbot[bot]
Browse files

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: default avatarJoas Schilling <coding@schilljs.com>
parent b2072cd6
No related branches found
No related tags found
No related merge requests found
...@@ -453,8 +453,6 @@ class MigrationService { ...@@ -453,8 +453,6 @@ class MigrationService {
$toSchema = $instance->changeSchema($this->output, function () use ($toSchema) { $toSchema = $instance->changeSchema($this->output, function () use ($toSchema) {
return $toSchema ?: new SchemaWrapper($this->connection); return $toSchema ?: new SchemaWrapper($this->connection);
}, ['tablePrefix' => $this->connection->getPrefix()]) ?: $toSchema; }, ['tablePrefix' => $this->connection->getPrefix()]) ?: $toSchema;
$this->markAsExecuted($version);
} }
if ($toSchema instanceof SchemaWrapper) { if ($toSchema instanceof SchemaWrapper) {
...@@ -466,6 +464,10 @@ class MigrationService { ...@@ -466,6 +464,10 @@ class MigrationService {
$this->connection->migrateToSchema($targetSchema); $this->connection->migrateToSchema($targetSchema);
$toSchema->performDropTableCalls(); $toSchema->performDropTableCalls();
} }
foreach ($toBeExecuted as $version) {
$this->markAsExecuted($version);
}
} }
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment