Skip to content

Commit 9d5e241

Browse files
Update 2021_05_28_121021_add_index_key_people_table.php
1 parent 392e5c2 commit 9d5e241

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/migrations/2021_05_28_121021_add_index_key_people_table.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ class AddIndexKeyPeopleTable extends Migration
1414
public function up()
1515
{
1616
Schema::table('people', function (Blueprint $table) {
17+
if (Schema::hasColumn('people', 'uid'))
18+
{
1719
$table->index(['id', 'uid']);
1820
});
21+
}
1922
}
2023

2124
/**
@@ -26,7 +29,11 @@ public function up()
2629
public function down()
2730
{
2831
Schema::table('people', function (Blueprint $table) {
32+
if (Schema::hasColumn('people', 'uid'))
33+
{
34+
{
2935
$table->dropIndex(['id', 'uid']);
36+
}
3037
});
3138
}
3239
}

0 commit comments

Comments
 (0)