[11.x] Added an event that reports files being deleted when calling the schema:dump --prune
command
#53870
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
art schema:dump
console command is able to report the end of a job by sending theSchemaDumped
event, but is unable to report file deletion if the command is called with the--prune
parameter.This PR adds a new event to implement this feature.
P.S.: I didn't find any tests to check both the
art schema:dump
command and the event, so I didn't add tests for the new event either.P.S.2: The static analyzer error has nothing to do with my code :)
P.S.3: My case that started it all:
I am developing a package to export data from tables selected by the developer. Yesterday I added the ability to delete files, but I was surprised that in Laravel the
SchemaDumped
event doesn't contain a label when calling the console command with the--prune
flag (and it shouldn't, because the essence of the event is related to the database schema, not to the files). That's why I decided to add a new event, called in case of launching a console command with the parameter of file trimming.