<?php

declare(strict_types=1);

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {
        if (! Schema::hasTable('recent_entries')) {
            Schema::create('recent_entries', function (Blueprint $table) {
                $table->id();

                $table->foreignIdFor(Config::get('recently.user_model'));
                $table->text('url');
                $table->string('icon');
                $table->string('title');

                $table->timestamps();
            });
        }
    }
};
