Schema Builder length of an integer

前端 未结 6 915
一整个雨季
一整个雨季 2021-01-01 21:17

I\'ve been searching around and the question was asked a few times, but no-one seem to be able to give a definite answer to it. How do you specify the integer length for the

6条回答
  •  迷失自我
    2021-01-01 21:58

    Now, in Laravel 5:

    $table->addColumn('integer', 'post', ['length' => '10']); // Creates INT(10)
    $table->addColumn('integer', 'post', ['length' => '10'])->unsigned(); // Creates Unsigned INT(10)
    $table->unsignedInteger('post'); // Creates Unsigned INT(10)
    
    $table->integer('post'); // Creates INT(11)
    $table->integer('post')->unsigned(); // Creates Unsigned INT(11)
    

提交回复
热议问题