3 use Illuminate\Database\Schema\Blueprint;
4 use Illuminate\Database\Migrations\Migration;
6 class CreateAttributesTable extends Migration
15 Schema::create('attributes', function (Blueprint $table) {
16 $table->increments('id');
17 $table->integer('entity_id');
18 $table->string('entity_type', 100);
19 $table->string('name');
20 $table->string('value');
23 $table->index('name');
24 $table->index('value');
25 $table->index(['entity_id', 'entity_type']);
30 * Reverse the migrations.
34 public function down()
36 Schema::drop('attributes');