How can I modify a migration in Laravel?

前端 未结 5 635
眼角桃花
眼角桃花 2020-12-29 23:49

I\'m trying to modify a existing migration. Here is my current migration class:

class CreateLogForUserTable extends Migration
{
    public function up()
             


        
5条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-30 00:20

    If your app is not in production and you seed your data, the best you can do is to run:

    php artisan migrate:refresh --seed
    

    This command will drop all tables and recreate them. Then it will seed the data.

    If you will create additional migrations for each change during development, you'll end up with hundreds of migrations classes.

提交回复
热议问题