<?php
declare(strict_types=1);

use Celena\Core\Database\Blueprint;
use Celena\Core\Database\Connection;
use Celena\Core\Database\Schema;

return function (Schema $schema, Connection $conn): void {
    $schema->create('celena_categories', function (Blueprint $t) {
        $t->id();
        $t->string('slug', 191);
        $t->string('title', 255);
        $t->text('description')->nullable();
        $t->bigInteger('parent_id')->nullable();
        $t->integer('sort_order')->default(0);
        $t->string('seo_title', 255)->nullable();
        $t->text('seo_description')->nullable();
        $t->datetime('created_at')->nullable();
        $t->datetime('updated_at')->nullable();
        $t->unique('slug');
        $t->index('parent_id');
    });
};
