Итак, у меня есть пользовательские первичные ключи, и я не уверен, нужно ли мне определять приращение как в eloquent, так и в миграциях?
Eloquent
class Question extends Model
{
protected $primaryKey = 'que_id';
protected $keyType = 'tinyInteger';
public $autoincrement = true;
}
Миграция
public function up()
{
Schema::create('questions', function (Blueprint $table) {
$table->tinyInteger('que_id')->autoIncrement();
$table->timestamps();
});
}
Или достаточно просто определить это так?
public function up()
{
Schema::create('questions', function (Blueprint $table) {
$table->tinyInteger('que_id')->primary();
$table->timestamps();
});
}