private readonly SetupDatabaseAdapter
$adapter,
private readonly MigrationCollectionFactory
$migrationFactory,
private readonly string
$version ) { } /**
* @return array{offset: int, total: int, isFinished: bool}
*/
public function migrate(int
$offset, Connection
$connection): array
{ $migrationLoader =
$this->migrationFactory->
getMigrationCollectionLoader($connection);
$coreMigrations =
$migrationLoader->
collectAllForVersion($this->version
);
if ($offset === 0
) { $this->adapter->
initializeShopwareDb($connection);
$coreMigrations->
sync();
} // use 7 s as max execution time, so the UI stays responsive
$maxExecutionTime =
min(\
ini_get('max_execution_time'
), 7
);