php - Laravel Migration return Incorrect table definition -


laravel migration return "incorrect table definition; there can 1 auto column , must defined key", why? link of code

damn, consider atomizing.

the second argument integer values when creating migrations not length of field rather if should or should not autoincrement.

https://github.com/laravel/framework/blob/330d11ba8cd3d6c0a54a1125943526b126147b5f/src/illuminate/database/schema/blueprint.php#l443

that's problem lies.

for example $table->integer('celular',15)->nullable();. laravel assume want autoincrement since 15 truthy value , since mysql doesn't allow more 1 column autoincrement got error.


Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -