Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
getMigrationGenerator example
$collection
->
sync
(
)
;
$this
->io->
writeln
(
'migrate Migrations'
)
;
$migrationCount
=
$this
->
getMigrationsCount
(
$collection
,
$until
,
$limit
)
;
$this
->io->
progressStart
(
$migrationCount
)
;
$migratedCounter
= 0;
try
{
foreach
(
$this
->
getMigrationGenerator
(
$collection
,
$until
,
$limit
)
as
$_return
)
{
$this
->io->
progressAdvance
(
)
;
++
$migratedCounter
;
}
}
catch
(
\Exception
$e
)
{
$this
->
finishProgress
(
$migratedCounter
,
$migrationCount
)
;
throw
new
MigrateException
(
$e
->
getMessage
(
)
. \PHP_EOL . 'Trace: ' . \PHP_EOL .
$e
->
getTraceAsString
(
)
,
$e
)
;
}
$this
->
finishProgress
(
$migratedCounter
,
$migrationCount
)
;
$this
->io->
writeln
(
sprintf
(
'all migrations for identifier: "%s" executed',
$identifier
)
)
;