<?php

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

class CreateArticlesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('articles', function (Blueprint $table) {
            $table->id();
            $table->timestamps();


            $table->text('thumbnail')->nullable();
            $table->string('title');
            $table->string('slug')->nullable();
            $table->text('category')->nullable();
            //$table->text('tags')->nullable(); //tidak diperlukan
            $table->text('preview')->nullable();
            $table->text('body')->nullable();
            $table->boolean('is_highlight')->default(0);
            $table->boolean('is_visible')->default(1);
            $table->dateTime('published_at')->nullable();
            $table->string('updated_by')->nullable();
            $table->string('created_by')->nullable();
        });
    }

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