<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20260322100000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Create organizer_invitation table';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('CREATE TABLE organizer_invitation (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, company_name VARCHAR(255) NOT NULL, first_name VARCHAR(255) NOT NULL, last_name VARCHAR(255) NOT NULL, email VARCHAR(255) NOT NULL, message TEXT DEFAULT NULL, status VARCHAR(20) NOT NULL, token VARCHAR(64) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, responded_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
        $this->addSql('CREATE UNIQUE INDEX UNIQ_ORG_INV_TOKEN ON organizer_invitation (token)');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('DROP TABLE organizer_invitation');
    }
}
