New Migrate:Fresh Command (4/14) - Laravel 5.5 New Features
We already have several migration commands and it feels like we get a few new ones with each Laravel release, but I promise that this one is actually worth looking into.
Migrate:fresh works similar to migrate:refresh but with one significant difference. The migrate:refresh command (the command we have had around for a very long time, used to run the down() function for all of our migration files, and then if successfully rolled back everything, it would run the migrations again in the correct order.
This was ok, except when we had an error in our down() functions. This happens for many reasons and not all of them are your fault. For example, sometimes an index can cause the problem, or something a minor typo. But this can be frustrating for developers that can’t successfully reset their database because of some problem in their migration files.
Now with the migrate:fresh command, Laravel simply drops all of the tables as opposed to running the down() functions. This is convenient for us because if you have a problem in the down() function it won’t throw an error. This is also a tad bit faster and over all, it just makes more sense.
I am excited to start working with the migrate:fresh command more and I plan to use it as my “default” command when I want to get a /fresh/ install of my Laravel database tables.
==== MORE FROM THIS SERIES . ====
Full Playlist for the “Laravel 5.5 New Features“ Series:
https://www.youtube.com/playlist?list=PLwAKR305CRO8GY3HVpXShlrXab8Cd7VT_
==== FOLLOW ME ====
Subscribe for New Releases!
Subscribe to DevMarketer Insider
[Email Newsletter]
https://confirmsubscription.com/h/d/5EDC91CF554832D1
Twitter - http://twitter.com/_jacurtis
(ask me questions!)
==== QUESTIONS? ====
Leave a comment below and I or someone else can help you.
For quick questions you may also want to ask me on Twitter, I respond almost immediately.
Email me hello@jacurtis.com
Thanks for all your support!
Видео New Migrate:Fresh Command (4/14) - Laravel 5.5 New Features канала DevMarketer
Migrate:fresh works similar to migrate:refresh but with one significant difference. The migrate:refresh command (the command we have had around for a very long time, used to run the down() function for all of our migration files, and then if successfully rolled back everything, it would run the migrations again in the correct order.
This was ok, except when we had an error in our down() functions. This happens for many reasons and not all of them are your fault. For example, sometimes an index can cause the problem, or something a minor typo. But this can be frustrating for developers that can’t successfully reset their database because of some problem in their migration files.
Now with the migrate:fresh command, Laravel simply drops all of the tables as opposed to running the down() functions. This is convenient for us because if you have a problem in the down() function it won’t throw an error. This is also a tad bit faster and over all, it just makes more sense.
I am excited to start working with the migrate:fresh command more and I plan to use it as my “default” command when I want to get a /fresh/ install of my Laravel database tables.
==== MORE FROM THIS SERIES . ====
Full Playlist for the “Laravel 5.5 New Features“ Series:
https://www.youtube.com/playlist?list=PLwAKR305CRO8GY3HVpXShlrXab8Cd7VT_
==== FOLLOW ME ====
Subscribe for New Releases!
Subscribe to DevMarketer Insider
[Email Newsletter]
https://confirmsubscription.com/h/d/5EDC91CF554832D1
Twitter - http://twitter.com/_jacurtis
(ask me questions!)
==== QUESTIONS? ====
Leave a comment below and I or someone else can help you.
For quick questions you may also want to ask me on Twitter, I respond almost immediately.
Email me hello@jacurtis.com
Thanks for all your support!
Видео New Migrate:Fresh Command (4/14) - Laravel 5.5 New Features канала DevMarketer
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
Microsoft gives up on Windows 10 Mobile, iOS Phishing Attack and More...FAQs [How to Build a Blog with Laravel]Part 24 ½ - Fixing a Slug Bug [How to Build a Blog with Laravel Series]Adding sliding admin nested menus - Episode 17 on Building an Advanced Blog/CMSStyling our Blog Post Creation Page (Ep. 21) - Build an Advanced Blog/CMS with LaravelThis Week In Web (Week 1 Oct 2017): Postgres v10, Microsofts Edge for Mobile, Dropbox BrandingIntroduction to Git [Git-ing Started with Git Series]Laravel 5.3 New Features - File ChangesDevMarketer Survey ResultsNews Dump and DD Collection Methods (5/14) - Laravel 5.5 New FeaturesPart 33 - Assigning Categories to Posts [How to Build a Blog with Laravel Series]Part 27 - Laravel Authentication Routes Views [How to Build a Blog with Laravel Series]Part 9: Eloquent Events - Laravel 5.4 New FeaturesPart 30½ - Authentication Shortcut [How to Build a Blog with Laravel 5 Series]Whoops is Back in Laravel 5.5 (1/14) - Laravel 5.5 New FeaturesPart 39 - Deleting Tags Safely [How to Build a Blog with Laravel 5 Series]Configuring Laratrust - Build an Advanced Blog/CMS (Episode 11)Early FAQ's - Build an Advanced Blog/ CMS from Start to FinishFinal Wireframe - Building an Advanced Blog/CMS (Episode 6)Part 16½ - Fixing a Bug, Making Navigation States work [How to Build a Blog with Laravel Series]