<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('posts', function (Blueprint $table)
        {
            $table->id();
            $table->string('title', 250);
            $table->string('slug', 250);
            $table->unsignedInteger('category_id');
            $table->string('color', 250);
            $table->string('image', 250);
            $table->text('body');
            $table->json('tags');
            $table->boolean('published')->default(false);
            $table->date('publish_at');
            $table->timestamps();
        });
    }

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