<?php

declare(strict_types=1);

namespace CpCreation\VitiCore\Bridge\Doctrine\Migrations;

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

final class Version20260721143000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Ajoute le pays, les coordonnées GPS et les horaires nécessaires aux données structurées LocalBusiness.';
    }

    public function up(Schema $schema): void
    {
        $this->addSql("ALTER TABLE contact_contact ADD country VARCHAR(2) DEFAULT 'FR' NOT NULL");
        $this->addSql('ALTER TABLE contact_contact ADD latitude NUMERIC(10, 7) DEFAULT NULL');
        $this->addSql('ALTER TABLE contact_contact ADD longitude NUMERIC(10, 7) DEFAULT NULL');
        $this->addSql("ALTER TABLE contact_contact ADD opening_hours JSON DEFAULT '[]' NOT NULL");
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE contact_contact DROP country');
        $this->addSql('ALTER TABLE contact_contact DROP latitude');
        $this->addSql('ALTER TABLE contact_contact DROP longitude');
        $this->addSql('ALTER TABLE contact_contact DROP opening_hours');
    }
}
