<?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 Version20251123150147 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 main (id SERIAL NOT NULL, president_id INT DEFAULT NULL, secretaire_id INT DEFAULT NULL, ag_date_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, locate VARCHAR(255) NOT NULL, locate_zipcode VARCHAR(255) NOT NULL, locate_city VARCHAR(255) NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
        $this->addSql('CREATE INDEX IDX_BF28CD64B40A33C7 ON main (president_id)');
        $this->addSql('CREATE INDEX IDX_BF28CD64A90F02B2 ON main (secretaire_id)');
        $this->addSql('COMMENT ON COLUMN main.ag_date_at IS \'(DC2Type:datetime_immutable)\'');
        $this->addSql('ALTER TABLE main ADD CONSTRAINT FK_BF28CD64B40A33C7 FOREIGN KEY (president_id) REFERENCES members (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
        $this->addSql('ALTER TABLE main ADD CONSTRAINT FK_BF28CD64A90F02B2 FOREIGN KEY (secretaire_id) REFERENCES members (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
    }

    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 main DROP CONSTRAINT FK_BF28CD64B40A33C7');
        $this->addSql('ALTER TABLE main DROP CONSTRAINT FK_BF28CD64A90F02B2');
        $this->addSql('DROP TABLE main');
    }
}
