<?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 Version20260121105005 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('CREATE TABLE allocation (id INT AUTO_INCREMENT NOT NULL, adherent_id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', cotisation_flux_id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\', complementary_flux_id CHAR(36) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', amount DOUBLE PRECISION NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_5C44232A25F06C53 (adherent_id), UNIQUE INDEX UNIQ_5C44232A363D74 (cotisation_flux_id), UNIQUE INDEX UNIQ_5C44232A7D9C219F (complementary_flux_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB');
        $this->addSql('ALTER TABLE allocation ADD CONSTRAINT FK_5C44232A25F06C53 FOREIGN KEY (adherent_id) REFERENCES adherent (id)');
        $this->addSql('ALTER TABLE allocation ADD CONSTRAINT FK_5C44232A363D74 FOREIGN KEY (cotisation_flux_id) REFERENCES flux (id)');
        $this->addSql('ALTER TABLE allocation ADD CONSTRAINT FK_5C44232A7D9C219F FOREIGN KEY (complementary_flux_id) REFERENCES flux (id)');
    }

    public function down(Schema $schema) : void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('DROP TABLE allocation');
    }
}
