Skip to content

Commit

Permalink
Update 2021_05_28_121021_add_index_key_people_table.php
Browse files Browse the repository at this point in the history
  • Loading branch information
curtisdelicata authored Aug 17, 2021
1 parent 392e5c2 commit 9d5e241
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ class AddIndexKeyPeopleTable extends Migration
public function up()
{
Schema::table('people', function (Blueprint $table) {
if (Schema::hasColumn('people', 'uid'))
{
$table->index(['id', 'uid']);
});
}
}

/**
Expand All @@ -26,7 +29,11 @@ public function up()
public function down()
{
Schema::table('people', function (Blueprint $table) {
if (Schema::hasColumn('people', 'uid'))
{
{
$table->dropIndex(['id', 'uid']);
}
});
}
}

0 comments on commit 9d5e241

Please sign in to comment.