-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow resetting the status of multiple migrations #5287
base: 11.x
Are you sure you want to change the base?
Allow resetting the status of multiple migrations #5287
Conversation
One thing I wasn't sure about is whether we should log Migration x is already Idle if passing the |
Yes lets omit those log messages. Less noise. |
eb49a02
to
6e3be62
Compare
Changed and rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good but we need to enrich the tests to cover also the --all
and --tag
cases.
throw new \Exception(dt('You must specify --all, --tag, or one or more migration names separated by commas')); | ||
} | ||
|
||
if (!$list = $this->getMigrationList($migrationIds, $options['tag'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've already assign $options['tag']
to $tags
. Why not use that var?
$status = $migration->getStatus(); | ||
if ($status !== MigrationInterface::STATUS_IDLE) { | ||
$migration->setStatus(MigrationInterface::STATUS_IDLE); | ||
$this->logger()->success(dt('Migration @id reset to Idle', ['@id' => $migrationId])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe Migration @id status reset to idle
(added the "status" word)
$migration->setStatus(MigrationInterface::STATUS_IDLE); | ||
$this->logger()->success(dt('Migration @id reset to Idle', ['@id' => $migrationId])); | ||
$tags = $options['tag']; | ||
$all = $options['all']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if some are using:
--all
with--tag
and some migration names?- but
--all
with--tag
? - or
--all
with a list of migrations?
Maybe we should remove --all
and NO MIGRATIONS == ALL? Then:
- no arguments, no options: All migrations
- only
--tag
: All migrations filtered by provided tags - migration IDs +
--tag
: should return error (or filter the list on tags?)
This PR adds the
all
andtag
options to themigrate:reset-status
command, together with the ability to pass a comma separated list of migration ids as argument.