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?

2 Answers 2

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)
Sign up to request clarification or add additional context in comments.

3 Comments

so conclusions can not use a length?
Yep. If you're looking for smaller integers, check out tinyInteger and smallInteger types.
Thank you very much
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

1 Comment

I had see it. The link says it can not using length

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.