我曾经学习过Laravel一段时间,为自己创建了一些基本项目,但今天我试图迁移包含更多整数的表格。但它仍然出现错误。
每个整数都尝试自动递增和成为主键,这可能是一个问题,但我不知道该如何解决。
Schema::create ('users', function (Blueprint $table)
{
$table->increments ('id');
$table->string ('email')->unique();
$table->string ('pass',250);
$table->integer ('tickets',4);
$table->integer ('tokens',4);
$table->integer ('in_raffle',4);
$table->text ('profile',500);
$table->string ('ip',20);
$table->integer ('ban',1);
$table->integer ('notice',1);
$table->timestamp ('last_login');
});
有人能告诉我怎么解决这个问题吗?需要编辑哪些内容才能让它正常工作?
非常感谢,祝你有愉快的一天!
链接:https://s28.postimg.org/fh3uaqdct/screen2.jpg
zerofill
时才真正有用。这是一篇好的文章。https://blogs.oracle.com/jsmyth/entry/what_does_the_11_mean - user1669496tinyInteger
、smallInteger
、mediumInteger
、integer
、bigInteger
。 - Alexey Mezenin