Altering a migration

Migration workflows are one more thing that makes Laravel such a great framework for teams as well as the lone developer. In this recipe, we are going to show the proper way to change a migration.

Getting ready

Even a fresh install will get you started, we just need a migration and then we will alter it. In this case, we are going to alter the users table.

How to do it....

Follow these steps to alter the users table:

  1. Inside Vagrant, run your migration if you have not already. We talked about setting up Vagrant in Chapter 1, Setting Up and Installing Laravel.
  2. Then type:
    >php artisan make:migration alter_users_table_add_twitter_name_field
    
  3. Now you will have the file in your database/migrations folder—edit that so it looks like the ...

Get Laravel 5.x Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.