<?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 Version20211118151204 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('ALTER TABLE tchat_groupe ADD admin_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE tchat_groupe ADD CONSTRAINT FK_547B7608642B8210 FOREIGN KEY (admin_id) REFERENCES utilisateur (id)');
        $this->addSql('CREATE INDEX IDX_547B7608642B8210 ON tchat_groupe (admin_id)');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('ALTER TABLE tchat_groupe DROP FOREIGN KEY FK_547B7608642B8210');
        $this->addSql('DROP INDEX IDX_547B7608642B8210 ON tchat_groupe');
        $this->addSql('ALTER TABLE tchat_groupe DROP admin_id');
    }
}
