E
E
Emil Rakhmatullin2019-10-04 13:00:09
MySQL
Emil Rakhmatullin, 2019-10-04 13:00:09

How to make id start with Nth number in MySQL database in Laravel?

How to specify $table->bigIncrements('id');start id from 100001, for example

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-10-04
@Emchik

//Your migrations here:
Schema::create('users', function (Blueprint $table) {
    $table->bigIncrements('id')->unsigned();
    $table->integer('qualification_id')->nullable();
    $table->integer('experience_id')->nullable();
});

//then set autoincrement to 1000
//after creating the table
DB::update("ALTER TABLE users AUTO_INCREMENT = 1000;");

https://stackoverflow.com/a/34196202/2981702

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question