Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible add tinyInteger or smallInteger to increments on laravel ORM?

Is possible to add that code or something like that to laravel\Illuminate\Database\Schema\Blueprint to use with migrations?

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

public function incrementsSmall($column)
{
   return $this->unsignedSmallInteger($column, true);
}

scenario: some temp table that don't grow high and have some useful information or just small table that do not have more than 100 lines and need some rare update (add or just change). But it is possible to add to the framework? Its common to have a lot information, but sometimes sometables dont have a lot of data.

Because for increments just have the option for integer or bigInteger

like image 420
Undefined Behavior Avatar asked Dec 12 '22 10:12

Undefined Behavior


1 Answers

You can use something like:

$table->tinyInteger('id')->unsigned()->autoIncrement();
like image 175
Wael Showair Avatar answered May 09 '23 18:05

Wael Showair