<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

final class Version20260220071333 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Create school_branding table for visual identity customization';
    }

    public function up(Schema $schema): void
    {
        $this->addSql(<<<'SQL'
            CREATE TABLE school_branding (
                school_id UUID PRIMARY KEY,
                tenant_id UUID NOT NULL,
                logo_url TEXT,
                logo_updated_at TIMESTAMPTZ,
                primary_color VARCHAR(7),
                secondary_color VARCHAR(7),
                accent_color VARCHAR(7),
                created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
                updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
            )
        SQL);

        $this->addSql(<<<'SQL'
            CREATE INDEX idx_branding_tenant ON school_branding(tenant_id)
        SQL);
    }

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