<?php

use Facade\Ignition\Tabs\Tab;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTableUsersLiveFeeds extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users_live_feeds', function (Blueprint $table) {
            $table->unsignedBigInteger('feed_id')->index();
            $table->unsignedBigInteger('user_id')->index();
            $table->unsignedBigInteger('home_user_id')->index();
            // $table->foreign('home_user_id')->references('id')->on('users')->onDelete('cascade');
            // $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            // $table->foreign('feed_id')->references('id')->on('feeds')->onDelete('cascade');
            $table->unsignedInteger('times')->default(0)->index();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users_live_feeds');
    }
}
