3 use Illuminate\Database\Migrations\Migration;
4 use Illuminate\Database\Schema\Blueprint;
5 use Illuminate\Support\Facades\Schema;
7 class CreateFavouritesTable extends Migration
16 Schema::create('favourites', function (Blueprint $table) {
17 $table->increments('id');
18 $table->integer('user_id')->index();
19 $table->integer('favouritable_id');
20 $table->string('favouritable_type', 100);
23 $table->index(['favouritable_id', 'favouritable_type'], 'favouritable_index');
28 * Reverse the migrations.
32 public function down()
34 Schema::dropIfExists('favourites');