diff --git a/tests/Integration/Database/SchemaBuilderTest.php b/tests/Integration/Database/SchemaBuilderTest.php index 1628a5b7ac76..e6523381bf8a 100644 --- a/tests/Integration/Database/SchemaBuilderTest.php +++ b/tests/Integration/Database/SchemaBuilderTest.php @@ -817,4 +817,25 @@ public function testAddingMacros() $this->assertTrue(Schema::hasForeignKeyForColumn('question_id', 'answers', 'questions')); $this->assertFalse(Schema::hasForeignKeyForColumn('body', 'answers', 'questions')); } + + #[RequiresDatabase(['mysql', 'mariadb', 'pgsql'])] + public function testStartingValueForAutoIncrementingColumn() + { + Schema::create('test', function (Blueprint $table) { + $table->bigIncrements('id')->from(100); + $table->string('name'); + }); + + $id = DB::table('test')->insertGetId(['name' => 'foo']); + + $this->assertSame(100, $id); + + Schema::table('test', function (Blueprint $table) { + $table->bigIncrements('id')->from(200)->change(); + }); + + $id = DB::table('test')->insertGetId(['name' => 'bar']); + + $this->assertSame(200, $id); + } }