%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/news/database/migrations/
Upload File :
Create Path :
Current File : /var/www/html/news/database/migrations/2017_04_22_154433_create_comments_table.php

<?php

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

class CreateCommentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('comments',function (Blueprint $table){
            $table->bigIncrements("id");
            $table->string("content");
            $table->boolean("is_approved")->default(false);
            $table->unsignedBigInteger("user_id");
            $table->foreign("user_id")->references("id")->on("users");
            $table->unsignedBigInteger("article_id");
            $table->foreign("article_id")->references("id")->on("articles");
            $table->timestamps();
        });
    }

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

Zerion Mini Shell 1.0