Skip to content

Commit

Permalink
Merge pull request #8 from jameswilddev/master
Browse files Browse the repository at this point in the history
Add "addressable" index
  • Loading branch information
DivineOmega authored Apr 1, 2021
2 parents 2763012 + be23eef commit c00ccb5
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddAddressableIndex extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('addresses', function (Blueprint $table) {
$table->index(['addressable_type', 'addressable_id']);
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('addresses', function (Blueprint $table) {
$table->dropIndex(['addressable_type', 'addressable_id']);
});
}
}

0 comments on commit c00ccb5

Please sign in to comment.