<?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 Version20230816082044 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 identification (id INT AUTO_INCREMENT NOT NULL, to_be_identified_id INT DEFAULT NULL, identified_id INT DEFAULT NULL, check_qr_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, status INT NOT NULL, date_created DATETIME NOT NULL, date_identified DATETIME DEFAULT NULL, INDEX IDX_49E7720DFD37E90F (to_be_identified_id), INDEX IDX_49E7720D9A0B45B5 (identified_id), INDEX IDX_49E7720DC0FC7995 (check_qr_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
        $this->addSql('ALTER TABLE identification ADD CONSTRAINT FK_49E7720DFD37E90F FOREIGN KEY (to_be_identified_id) REFERENCES person (id)');
        $this->addSql('ALTER TABLE identification ADD CONSTRAINT FK_49E7720D9A0B45B5 FOREIGN KEY (identified_id) REFERENCES person (id)');
        $this->addSql('ALTER TABLE identification ADD CONSTRAINT FK_49E7720DC0FC7995 FOREIGN KEY (check_qr_id) REFERENCES check_qr (id)');
        $this->addSql('ALTER TABLE person_auth_history ADD app_version VARCHAR(50) DEFAULT NULL');
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->addSql('DROP TABLE identification');
        $this->addSql('ALTER TABLE person_auth_history DROP app_version');
    }
}
