Fixed a number of bugs in the module:migrate + module:seed commands #46
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.
Refactored the "module:seed" command logic in order to reduce code duplication.
Fixed an existing bug which would cause the "module:migrate" command to throw an offset warning if the --seed option is specified.
Fixed a newly introduced bug(my bad) where the SeedCommand:dbseed() method would append the base module namespace to the FQN of a seeder class. This would only occur if the user had provided an explicit classname using the optional "migration.seeds" argument.
Removed the "class option" from "module:seed" since it should logically only be set from within the dbSeed($class) method which in turn issues each of these calls directly to the "db:seed" command.
Removed the "all option" from "module:seed" since it actually wasn't being used for anything.
ie: The existing behavior for this command is to seed all modules if the module argument is not specified.
Removed the MigrateCommand:getPath() method in favor of (Migrator($module))->getPath() which has been updated to account for the additional logic.
Note: Since the Laravel "migrate" command requires a path which is relative to the base_root() module:migrate will still executing a string replacement on the result.
Update:
In order to further reduce code duplication I made some more changes to the MigrationPublisher class which will now accept Migrator as a class dependency.
Calls to the MigrationPublisher:getSourcePath() method should be delegated to the Migrator:getPath().
Note: It doesn't look like this class even needs to extend the AssetPublisher. It could probably just extend Publisher but I decided to leave it as is for now.