<?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_webhooks', function (Blueprint $t) {
        $t->id();
        $t->string('event', 64);
        $t->string('url', 500);
        $t->string('secret', 128)->nullable();
        $t->boolean('is_active')->default(true);
        $t->integer('last_status')->nullable();
        $t->datetime('last_sent_at')->nullable();
        $t->datetime('created_at')->nullable();
        $t->index('event');
    });
};
