Laravel migration table field's type change

后端 未结 7 1480
难免孤独
难免孤独 2020-12-08 12:45

Following is my file 2015_09_14_051851_create_orders_table.php. And I want to change $table->integer(\'category_id\'); as a string with new migratio

相关标签:
7条回答
  • 2020-12-08 13:42

    For me the solution was just replace unsigned with index

    This is the full code:

        Schema::create('champions_overview',function (Blueprint $table){
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->integer('cid')->index();
            $table->longText('name');
        });
    
    
        Schema::create('champions_stats',function (Blueprint $table){
            $table->engine = 'InnoDB';
            $table->increments('id');
            $table->integer('championd_id')->index();
            $table->foreign('championd_id', 'ch_id')->references('cid')->on('champions_overview');
        });
    
    0 讨论(0)
提交回复
热议问题