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
{{ message }}
This repository was archived by the owner on Jan 24, 2024. It is now read-only.
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;
}