<?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 Version20251123210026 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 ag_main_signed (id SERIAL NOT NULL, main_id INT DEFAULT NULL, members_id INT DEFAULT NULL, submiter_id VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
        $this->addSql('CREATE INDEX IDX_1726DFDA627EA78A ON ag_main_signed (main_id)');
        $this->addSql('CREATE INDEX IDX_1726DFDABD01F5ED ON ag_main_signed (members_id)');
        $this->addSql('ALTER TABLE ag_main_signed ADD CONSTRAINT FK_1726DFDA627EA78A FOREIGN KEY (main_id) REFERENCES ag_main (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
        $this->addSql('ALTER TABLE ag_main_signed ADD CONSTRAINT FK_1726DFDABD01F5ED FOREIGN KEY (members_id) REFERENCES members (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
        $this->addSql('ALTER TABLE ag_main ADD is_attestation BOOLEAN DEFAULT NULL');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('CREATE SCHEMA public');
        $this->addSql('ALTER TABLE ag_main_signed DROP CONSTRAINT FK_1726DFDA627EA78A');
        $this->addSql('ALTER TABLE ag_main_signed DROP CONSTRAINT FK_1726DFDABD01F5ED');
        $this->addSql('DROP TABLE ag_main_signed');
        $this->addSql('ALTER TABLE ag_main DROP is_attestation');
    }
}
