Skip to content

Commit 9593a33

Browse files
authored
Merge pull request #231 from RonasIT/update-migration-stub
refactor: update migration stub to use id instead of increments
2 parents 1638741 + eac42cb commit 9593a33

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

stubs/migration.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function up(): void
1313
$this->createTable();
1414
@else
1515
Schema::create('{{ \Illuminate\Support\Str::plural(\Illuminate\Support\Str::snake($entity)) }}', function (Blueprint $table) {
16-
$table->increments('id');
16+
$table->id();
1717
@foreach ($table as $row )
1818
{!!$row!!}
1919
@endforeach
@@ -59,7 +59,7 @@ public function down(): void
5959
public function createTable(): void
6060
{
6161
Schema::create('{{ \Illuminate\Support\Str::plural(\Illuminate\Support\Str::snake($entity)) }}', function (Blueprint $table) {
62-
$table->increments('id');
62+
$table->id();
6363
@foreach ($table as $row )
6464
{!!$row!!}
6565
@endforeach

tests/fixtures/CommandTest/migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public function up(): void
1313
{
1414
Schema::create('posts', function (Blueprint $table) {
15-
$table->increments('id');
15+
$table->id();
1616
$table->timestamps();
1717
});
1818
}

tests/fixtures/MigrationGeneratorTest/generated_mysql_migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public function up(): void
1313
{
1414
Schema::create('posts', function (Blueprint $table) {
15-
$table->increments('id');
15+
$table->id();
1616
$table->integer('media_id');
1717
$table->integer('user_id');
1818
$table->string('title')->nullable();

tests/fixtures/MigrationGeneratorTest/migrations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
public function up(): void
1313
{
1414
Schema::create('posts', function (Blueprint $table) {
15-
$table->increments('id');
15+
$table->id();
1616
$table->integer('media_id');
1717
$table->integer('user_id');
1818
$table->string('title')->nullable();

0 commit comments

Comments
 (0)