drvvepadi289421028 2017-06-26 12:06
浏览 6
已采纳

尝试迁移时Laravel错误

I want to add another column to my database table users. I made a new migration named Modify_users_tablewhich has the code to add the column. There is nothing wrong with the source code because I used it before, but it gives me an error that something is wrong with the table roles? How can I solve this? Here is the error and the code that is related to the error enter image description here

Here is the migration Roles:

 public function up()
{
    Schema::create('roles', function (Blueprint $table) {
        $table->string('role_name')->length(55)->unique();
        $table->increments('id');
        $table->timestamps();
    });
}
  • 写回答

4条回答 默认 最新

  • dongpo1599 2017-06-26 12:10
    关注

    You need to run

    php artisan migrate:rollback
    

    if that also fails just go in and drop all the tables which you may have to do as it seems your migration table is messed up or your roles table when you ran a previous rollback did not drop the table.

    or you can use migrate:reset command will roll back all of your application's migrations:

    php artisan migrate:reset
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 yolov8边框坐标
  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真