-
Notifications
You must be signed in to change notification settings - Fork 11.3k
[5.0] Adds "--path" to the migrate:reset command #7884
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
Conversation
while (true) | ||
{ | ||
$count = $this->migrator->rollback($pretend); | ||
$count = $this->migrator->rollback($pretend, $path); |
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 indentation seems to be wrong.
You change files permissions. Care about that. |
@RomainLanz i missed some of those - just figured out that laravel doesn't follow PSR-2 coding style. Thanks for pointing those out. |
Laravel doesn't follow PSR-2 now, probably on the future. Still dot missing on line 182. |
Please squash to one commit. |
Hi @GrahamCampbell done. Thanks! |
$migrationEntries = []; | ||
foreach ($files as $file) | ||
{ | ||
// Remove the .php from the filenames |
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.
You should maybe just use glob in the first place?
@GrahamCampbell now using glob instead of scandir. Glob returns the full path of the files though but using Let me know if you're ok with it and I can squash to one commit again. |
$files = glob($path . '/*.php'); | ||
|
||
$migrationEntries = []; | ||
foreach ($files as $file) |
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.
missing a new line before this block.
@GrahamCampbell moved |
Thanks. |
I'm not sure why this would be needed? |
Hi Taylor Here is an example use case: Let's say I wanted to install a Laravel package and it has its own migration files. Part of the instructions would be to migrate them using But let's say we don't need the package anymore and wanted to remove only the migrations from that package without having to touch the main application's tables. Or another scenario would be that there was an updated migration file from the package. We don't want to reset the whole database just for this package. In this case, we can use |
good idea, also why we have only one hardcoded in config emailView for reset password ? |
Going to hold off on this for now. |
+1 great feature but please redo it for 5.1 |
Changes Unknown when pulling f7ce2d5 on chrisbjr:5.0 into * on laravel:5.0*. |
Hi all,
I've added a
--path
option to themigrate:reset
command.Usage for this should be similar to the
php artisan migrate --path="..."
command.So after doing the above command, you can do this:
php artisan migrate:reset --path="..."
I'm adding this because we have the option of doing a migration from a specified path but have no option to reset the migration from that path itself.
Hoping you consider this pull request.
Thanks
Chris