是否可以在laravel ORM上添加tinyInteger或smallInteger来递增?

Und*_*ior 4 php orm laravel eloquent laravel-4

是否可以将该代码或类似内容添加到laravel\Illuminate\Database\Schema\Blueprint以用于迁移?

public function incrementsTiny($column)
{
   return $this->unsignedTinyInteger($column, true);
}

public function incrementsSmall($column)
{
   return $this->unsignedSmallInteger($column, true);
}
Run Code Online (Sandbox Code Playgroud)

场景:一些临时表不会增长并且有一些有用的信息,或者只是一个不超过100行的小表,需要一些罕见的更新(添加或只是更改).但是有可能添加到框架中吗?它通常有很多信息,但有时候某些表没有很多数据.

因为增量只有整数或bigInteger选项

Wae*_*air 11

您可以使用以下内容:

$table->tinyInteger('id')->unsigned()->autoIncrement();
Run Code Online (Sandbox Code Playgroud)