2

if the code like this : $table->integer('no', 3);, it's failed

if the code like this : $table->integer('no');, it's success

why when I use lenth, it failed to migrate db?

samuel toh
  • 6,836
  • 21
  • 71
  • 108

2 Answers2

1

That's because integer() second parameter is $autoIncrement which accepts true or false. You can't pass 3:

public function integer($column, $autoIncrement = false, $unsigned = false)
Alexey Mezenin
  • 158,981
  • 26
  • 290
  • 279
0

You cannot specify the length of an integer column, if that is what you are trying to accomplish. See this answer here for a full explanation https://stackoverflow.com/a/25772960/7202919

Community
  • 1
  • 1
httpoz
  • 96
  • 5