Add a new column to existing table in a migration

前端 未结 12 2625
离开以前
离开以前 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 17:44

    WARNING this is a destructive action. If you use this ensure you back up your database first

    you can simply modify your existing migration file, for example adding a column in your table, and then in your terminal typing :

    $ php artisan migrate:refresh
    

提交回复
热议问题