Laravel 5.2 how to update migration without losing data

前端 未结 4 1614
天涯浪人
天涯浪人 2021-01-30 13:27

I\'m using laravel 5.2 and I usually update my database according to project requirements, so I\'d like to do it without losing database records. I don\'t mean how to seed my da

4条回答
  •  抹茶落季
    2021-01-30 14:13

    Make sure that when you are adding new column in your table, that column should be nullable, and should not be unique. Otherwise you will face error. Because when a new column is created it will be empty(not unique). In that condition you have to rollback the migration.

提交回复
热议问题