<?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 Version20250411113705 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("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_BASE_AMOUNT', 'Valeur de la part de base dans l\allocation par foyer', '150', '1')");
        $this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_SECONDARY_AMOUNT', 'Valeur des autres parts dans l\allocation par foyer (e.g. à partir du deuxième adulte, enfants à charge, etc...)', '75', '1')");
        $this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_DEPENDANT_CHILD_LIMIT_AGE', 'Age limite des enfants à charge', '14', '1')");
        $this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_DEPENDANT_CHILD_UNDER_LIMIT_AMOUNT', 'Si défini, valeur des parts pour les enfants à charge sous la limite d\'age. Si non défini, utilise SSA_HOUSEHOLD_SECONDARY_AMOUNT pour tous les enfants à charge.', null, '0')");
        $this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_USE_SHARED_CUSTODY', 'Si la valeur est à true, active et prend en compte la garde partagé pour les enfants à charge dans le calcul de l\'allocation', 'true', '0')");
        $this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'SSA_HOUSEHOLD_MAX_ALLOCATION_AMOUNT', 'Si une valeur est renseignée, applique la valeur comme plafond de montant d\'allocation dans le calcul', null, '0')");
        $this->addSql('ALTER TABLE dependent_child CHANGE older_than_fourteen older_than_limit_age TINYINT(1) NOT NULL');
    }
    
    public function down(Schema $schema) : void
    {
        $this->addSql("DELETE FROM global_parameter WHERE name='SSA_HOUSEHOLD_BASE_AMOUNT'");
        $this->addSql("DELETE FROM global_parameter WHERE name='SSA_HOUSEHOLD_SECONDARY_AMOUNT'");
        $this->addSql("DELETE FROM global_parameter WHERE name='SSA_HOUSEHOLD_DEPENDANT_CHILD_LIMIT_AGE'");
        $this->addSql("DELETE FROM global_parameter WHERE name='SSA_HOUSEHOLD_DEPENDANT_CHILD_UNDER_LIMIT_AMOUNT'");
        $this->addSql("DELETE FROM global_parameter WHERE name='SSA_HOUSEHOLD_USE_SHARED_CUSTODY'");
        $this->addSql("DELETE FROM global_parameter WHERE name='SSA_HOUSEHOLD_MAX_ALLOCATION_AMOUNT'");
        $this->addSql('ALTER TABLE dependent_child CHANGE older_than_limit_age older_than_fourteen TINYINT(1) NOT NULL');
        // this down() migration is auto-generated, please modify it to your needs
    }
}
