关于 artisan migrate 的问题,如何给 tinyInteger 类型加长度限制?
public function tinyInteger($column, $autoIncrement = false, $unsigned = false)
{
return $this->addColumn('tinyInteger', $column, compact('autoIncrement', 'unsigned'));
}
怎么设置tinyInteger的长度捏?
Schema::create('backend_user', function (Blueprint $table) {
$table->increments('id');
$table->string('nickname');
$table->string('email')->unique();
$table-> tinyInteger('type)->unique();
$table->string('password', 32);
$table->timestamps();
});
推荐文章: