lundi 3 février 2020

How to let ID autoincrement start from certain number in Laravel Migration

I want to write a Laravel Migration auto increment ID as a primary key. I want to start this ID with a another value rather than 1. How can I do so ?

The migration up() function:

public function up()
{
    Schema::create('users', function (Blueprint $table) {
        $table->bigIncrements('id');
        $table->string('name');
        $table->string('email')->unique();
        $table->string('phone');
        $table->rememberToken();
        $table->timestamps();
    });
}


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire