Add a new column to existing table in a migration

前端 未结 12 2648
离开以前
离开以前 2020-11-28 17:09

I can\'t figure out how to add a new column to my existing database table using the Laravel framework.

I tried to edit the migration file using...



        
12条回答
  •  野性不改
    2020-11-28 18:00

    First rollback your previous migration

    php artisan migrate:rollback
    

    After that, you can modify your existing migration file (add new , rename or delete columns) then Re-Run your migration file

    php artisan migrate
    

提交回复
热议问题