-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[5.1] Implemented 'logging' and 'file' options for the artisan migrate command #10726
Conversation
- Also fixed existing unit tests
@@ -34,8 +34,7 @@ class MigrateCommand extends BaseCommand | |||
/** | |||
* Create a new migration command instance. | |||
* | |||
* @param \Illuminate\Database\Migrations\Migrator $migrator | |||
* @return void | |||
* @param Migrator $migrator |
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.
please revert all changes to the phpdoc
Please fix the numerous CS issues as highlighted by StyleCI for you. |
This should have really been two different PRs. We don't have any plans to add a --file option to migrations as is to doesn't really make sense to run individual files when migrations are specifically supposed to be run in a given order. |
Yer i wondered whether that may go against the general use case for migrations; figured it was worth a mention though as i tend to run the migrations quite a lot when writing/debugging. That being said, it works just as well to implement this in the service providers without too much hassle so maybe its better placed in a blog post for the edge case uses :) |
when you working on some project and you don't want to remove all your current data for some reasons and want to add next table there is a problem there are seeds but sometimes it is not that simple - when your data must be created with other actions as well, |
The benefits of logging are obvious in production when the integrity and state of the database are vital; however, often during development migrations will be run many times to test and debug them. Currently this process is quite difficult and often means either executing the rollback command after each migration (assuming this method is error free) or updating the migrations table in the database.
There was an issue a while back about a similar thing #2085
By adding the --file option, a single migration file can be run (it accepts both a full file name or just the migration name; minus the timestamp prefix)
By adding the --logging=0 option logging can be disabled so that a migration can be run many times without altering the database or rolling back.
Anyways its the first time i have contributed to Laravel so if i have missed anything then just let me know. Im happy to write more tests to cover the new options etc, just wanted to see if there was any interest and to make sure that this doesn't go against the general idea of how migrations should be used before doing any more.