Reseeding MySQL index

matthewmalone posted 3 years ago

When creating a table ("quotations") in a migration I want to set the index start count...

DB::statement('DBCC CHECKIDENT (\'quotations\', RESEED, 6000);');

The above keep on giving an error "you have an error in your SQL syntax". What am I doing wrong?

ftiersch replied 3 years ago

That command doesn't seem to exist in MySQL. See that thread on StackOverflow.

monaye replied 3 years ago Solution

Here is how I do.

$statement = "ALTER TABLE quotations AUTO_INCREMENT = 1;";

Sign in to participate in this thread!

We'd like to thank these amazing companies for supporting us