<?php

declare(strict_types=1);

namespace DoctrineMigrations;

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

final class Version20260502120210 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Normalize index names and datetime columns after multi-parcours migration';
    }

    public function up(Schema $schema): void
    {
        $this->addSql('ALTER TABLE inscription_parcours CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX idx_inscription_parcours_ecole TO IDX_3024A14677EF1B1E');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX idx_inscription_parcours_inscription TO IDX_3024A1465DAC5993');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX idx_inscription_parcours_annee TO IDX_3024A1469331C741');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX idx_inscription_parcours_section_souhaitee TO IDX_3024A1468AAC02CD');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX idx_inscription_parcours_niveau_souhaite TO IDX_3024A146EB809123');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX idx_inscription_parcours_classe_souhaitee TO IDX_3024A146EB7D15A3');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX idx_inscription_parcours_section_finale TO IDX_3024A146B5824D8D');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX idx_inscription_parcours_niveau_final TO IDX_3024A146AAD2DB9E');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX idx_inscription_parcours_classe_finale TO IDX_3024A146E69B7D2F');

        $this->addSql('ALTER TABLE parcours_etudiant CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX idx_parcours_etudiant_ecole TO IDX_F3F9BD1C77EF1B1E');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX idx_parcours_etudiant_etudiant TO IDX_F3F9BD1CDDEAB1A3');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX idx_parcours_etudiant_annee TO IDX_F3F9BD1C9331C741');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX idx_parcours_etudiant_section TO IDX_F3F9BD1CD823E37A');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX idx_parcours_etudiant_niveau TO IDX_F3F9BD1CB3E9C81');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX idx_parcours_etudiant_classe TO IDX_F3F9BD1C8F5EA509');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX idx_parcours_etudiant_inscription TO IDX_F3F9BD1C5DAC5993');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX idx_parcours_etudiant_inscription_parcours TO IDX_F3F9BD1C99495D0B');

        $this->addSql('ALTER TABLE tenant_domains CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
        $this->addSql('ALTER TABLE tenant_domains RENAME INDEX uniq_7a11e337604b8382 TO UNIQ_9EEDFDA9CF2713FD');
        $this->addSql('ALTER TABLE tenant_domains RENAME INDEX idx_7a11e33777ef1b1e TO IDX_9EEDFDA977EF1B1E');
    }

    public function down(Schema $schema): void
    {
        $this->addSql('ALTER TABLE tenant_domains RENAME INDEX IDX_9EEDFDA977EF1B1E TO idx_7a11e33777ef1b1e');
        $this->addSql('ALTER TABLE tenant_domains RENAME INDEX UNIQ_9EEDFDA9CF2713FD TO uniq_7a11e337604b8382');
        $this->addSql('ALTER TABLE tenant_domains CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\'');

        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX IDX_F3F9BD1C99495D0B TO idx_parcours_etudiant_inscription_parcours');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX IDX_F3F9BD1C5DAC5993 TO idx_parcours_etudiant_inscription');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX IDX_F3F9BD1C8F5EA509 TO idx_parcours_etudiant_classe');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX IDX_F3F9BD1CB3E9C81 TO idx_parcours_etudiant_niveau');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX IDX_F3F9BD1CD823E37A TO idx_parcours_etudiant_section');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX IDX_F3F9BD1C9331C741 TO idx_parcours_etudiant_annee');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX IDX_F3F9BD1CDDEAB1A3 TO idx_parcours_etudiant_etudiant');
        $this->addSql('ALTER TABLE parcours_etudiant RENAME INDEX IDX_F3F9BD1C77EF1B1E TO idx_parcours_etudiant_ecole');
        $this->addSql('ALTER TABLE parcours_etudiant CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\'');

        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX IDX_3024A146E69B7D2F TO idx_inscription_parcours_classe_finale');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX IDX_3024A146AAD2DB9E TO idx_inscription_parcours_niveau_final');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX IDX_3024A146B5824D8D TO idx_inscription_parcours_section_finale');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX IDX_3024A146EB7D15A3 TO idx_inscription_parcours_classe_souhaitee');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX IDX_3024A146EB809123 TO idx_inscription_parcours_niveau_souhaite');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX IDX_3024A1468AAC02CD TO idx_inscription_parcours_section_souhaitee');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX IDX_3024A1469331C741 TO idx_inscription_parcours_annee');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX IDX_3024A1465DAC5993 TO idx_inscription_parcours_inscription');
        $this->addSql('ALTER TABLE inscription_parcours RENAME INDEX IDX_3024A14677EF1B1E TO idx_inscription_parcours_ecole');
        $this->addSql('ALTER TABLE inscription_parcours CHANGE created_at created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', CHANGE updated_at updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\'');
    }
}
