<?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('leads', function (Blueprint $t) {
        $t->id();
        $t->string('name', 150)->default('');
        $t->string('phone', 60)->default('');
        $t->string('email', 150)->nullable();
        $t->string('service', 80)->nullable();
        $t->text('message')->nullable();
        $t->string('ip', 45)->nullable();
        $t->string('user_agent', 255)->nullable();
        $t->string('page_url', 255)->nullable();
        $t->string('lang', 8)->nullable();
        $t->string('status', 20)->default('new');
        $t->datetime('created_at')->nullable();
        $t->index('status');
    });
};
