<?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 Version20260427221834 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('ALTER TABLE etudiants ADD a_des_enfants TINYINT DEFAULT 0 NOT NULL, ADD jours_disponibles LONGTEXT DEFAULT NULL, ADD plage_horaire_souhaitee VARCHAR(160) DEFAULT NULL, ADD annee_scolaire_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE etudiants ADD CONSTRAINT FK_227C02EB9331C741 FOREIGN KEY (annee_scolaire_id) REFERENCES annees_scolaires (id) ON DELETE SET NULL');
        $this->addSql('CREATE INDEX IDX_227C02EB9331C741 ON etudiants (annee_scolaire_id)');
        $this->addSql('ALTER TABLE inscriptions ADD a_des_enfants TINYINT DEFAULT 0 NOT NULL, ADD jours_disponibles LONGTEXT DEFAULT NULL, ADD plage_horaire_souhaitee VARCHAR(160) DEFAULT NULL, ADD annee_scolaire_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE inscriptions ADD CONSTRAINT FK_74E0281C9331C741 FOREIGN KEY (annee_scolaire_id) REFERENCES annees_scolaires (id) ON DELETE SET NULL');
        $this->addSql('CREATE INDEX IDX_74E0281C9331C741 ON inscriptions (annee_scolaire_id)');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE etudiants DROP FOREIGN KEY FK_227C02EB9331C741');
        $this->addSql('DROP INDEX IDX_227C02EB9331C741 ON etudiants');
        $this->addSql('ALTER TABLE etudiants DROP a_des_enfants, DROP jours_disponibles, DROP plage_horaire_souhaitee, DROP annee_scolaire_id');
        $this->addSql('ALTER TABLE inscriptions DROP FOREIGN KEY FK_74E0281C9331C741');
        $this->addSql('DROP INDEX IDX_74E0281C9331C741 ON inscriptions');
        $this->addSql('ALTER TABLE inscriptions DROP a_des_enfants, DROP jours_disponibles, DROP plage_horaire_souhaitee, DROP annee_scolaire_id');
    }
}
