<?php

declare(strict_types=1);

namespace Chill\Migrations\Person;

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

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20250527122841 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Remove NOT NULL constraints for created and updated properties on accompanying period work';
    }

    public function up(Schema $schema): void
    {
        $this->addSql(<<<'SQL'
            ALTER TABLE chill_person_accompanying_period_work ALTER createdby_id DROP NOT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE chill_person_accompanying_period_work ALTER updatedby_id DROP NOT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE chill_person_accompanying_period_work ALTER createdat DROP NOT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE chill_person_accompanying_period_work ALTER updatedat DROP NOT NULL
        SQL);
    }

    public function down(Schema $schema): void
    {
        $this->addSql(<<<'SQL'
            ALTER TABLE chill_person_accompanying_period_work ALTER createdAt SET NOT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE chill_person_accompanying_period_work ALTER updatedAt SET NOT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE chill_person_accompanying_period_work ALTER createdBy_id SET NOT NULL
        SQL);
        $this->addSql(<<<'SQL'
            ALTER TABLE chill_person_accompanying_period_work ALTER updatedBy_id SET NOT NULL
        SQL);
    }
}
