<?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 Version20221229104950 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 check_qr (id INT AUTO_INCREMENT NOT NULL, libelle VARCHAR(255) NOT NULL, numero VARCHAR(25) NOT NULL, chemin VARCHAR(100) DEFAULT NULL, date_created DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
        $this->addSql('ALTER TABLE person ADD check_qr_id INT DEFAULT NULL');
        $this->addSql('ALTER TABLE person ADD CONSTRAINT FK_34DCD176C0FC7995 FOREIGN KEY (check_qr_id) REFERENCES check_qr (id)');
        $this->addSql('CREATE INDEX IDX_34DCD176C0FC7995 ON person (check_qr_id)');
    }

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