<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('flux_cms_linkedin_posts', function (Blueprint $table) {
            $table->id();
            $table->string('linkedin_id')->nullable()->unique();
            $table->json('title');
            $table->json('excerpt')->nullable();
            $table->json('content')->nullable();
            $table->string('author')->nullable();
            $table->date('date')->nullable();
            $table->string('url')->nullable();
            $table->string('image')->nullable();
            $table->json('tags')->nullable();
            $table->string('source')->default('manual');
            $table->boolean('is_published')->default(true);
            $table->integer('order')->default(0);
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('flux_cms_linkedin_posts');
    }
};
