<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20250629130947 extends AbstractMigration
{
    public function getDescription(): string
    {
        return '';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->addSql(<<<'SQL'
            ALTER TABLE city_follow_up ADD stats_id INT DEFAULT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE city_follow_up ADD CONSTRAINT FK_DFE8468970AA3482 FOREIGN KEY (stats_id) REFERENCES stats (id)
        SQL);
        $this->addSql(<<<'SQL'
            CREATE INDEX IDX_DFE8468970AA3482 ON city_follow_up (stats_id)
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE place CHANGE email email VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE note note VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE name name VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE note_content note_content VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE street street VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE housenumber housenumber VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE siret siret VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE osm_user osm_user VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`, CHANGE email_content email_content LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_0900_ai_ci`
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE stats DROP FOREIGN KEY FK_574767AAA543722E
        SQL);
        $this->addSql(<<<'SQL'
            DROP INDEX IDX_574767AAA543722E ON stats
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE stats DROP city_follow_ups_id
        SQL);
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql(<<<'SQL'
            ALTER TABLE stats ADD city_follow_ups_id INT DEFAULT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE stats ADD CONSTRAINT FK_574767AAA543722E FOREIGN KEY (city_follow_ups_id) REFERENCES city_follow_up (id) ON UPDATE NO ACTION ON DELETE NO ACTION
        SQL);
        $this->addSql(<<<'SQL'
            CREATE INDEX IDX_574767AAA543722E ON stats (city_follow_ups_id)
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE city_follow_up DROP FOREIGN KEY FK_DFE8468970AA3482
        SQL);
        $this->addSql(<<<'SQL'
            DROP INDEX IDX_DFE8468970AA3482 ON city_follow_up
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE city_follow_up DROP stats_id
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE place CHANGE email email VARCHAR(255) DEFAULT NULL, CHANGE note note VARCHAR(255) DEFAULT NULL, CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE note_content note_content VARCHAR(255) DEFAULT NULL, CHANGE street street VARCHAR(255) DEFAULT NULL, CHANGE housenumber housenumber VARCHAR(255) DEFAULT NULL, CHANGE siret siret VARCHAR(255) DEFAULT NULL, CHANGE osm_user osm_user VARCHAR(255) DEFAULT NULL, CHANGE email_content email_content LONGTEXT DEFAULT NULL
        SQL);
    }
}
