You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In v1 there is a problem that migrations are not sorted by creation date so they are displayed and processed in the wrong order.
Please add sorting to the Migrator get migrations.
This code worked for me:
public function getMigrations(): array
{
$result = [];
foreach ($this->repository->getMigrations() as $migration) {
//Populating migration status and execution time (if any)
$result[] = $migration->withState($this->resolveStatus($migration->getState()));
}
usort($result, function ($a, $b)
{
$aTimeCreated=$a->getState()->getTimeCreated();
$bTimeCreated=$b->getState()->getTimeCreated();
if ($aTimeCreated == $bTimeCreated) {
return 0;
}
return ($aTimeCreated < $bTimeCreated) ? -1 : 1;
});
return $result;
}
In v1 there is a problem that migrations are not sorted by creation date so they are displayed and processed in the wrong order.
Please add sorting to the Migrator get migrations.
This code worked for me: