<?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 Version20230705181357 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 transaction ADD card_user_id INT DEFAULT NULL, ADD check_qr_id INT DEFAULT NULL, ADD civility VARCHAR(50) DEFAULT NULL, ADD first_name VARCHAR(100) NOT NULL, ADD phone VARCHAR(20) DEFAULT NULL, ADD phone2 VARCHAR(50) DEFAULT NULL, ADD is_phone TINYINT(1) DEFAULT NULL, ADD is_identificationdocument TINYINT(1) DEFAULT NULL, ADD type_of_identification_document VARCHAR(100) DEFAULT NULL, ADD identification_document_number VARCHAR(100) DEFAULT NULL, ADD identification_document_validity DATE DEFAULT NULL, ADD type_of_operation VARCHAR(100) DEFAULT NULL, ADD domiciliation_institution VARCHAR(100) DEFAULT NULL, ADD account_type VARCHAR(100) DEFAULT NULL, ADD account_action VARCHAR(100) DEFAULT NULL, ADD amount DOUBLE PRECISION NOT NULL, ADD account_proprietor VARCHAR(255) DEFAULT NULL, ADD account_number VARCHAR(50) DEFAULT NULL, ADD card_type VARCHAR(100) DEFAULT NULL, ADD card_action VARCHAR(50) DEFAULT NULL, ADD card_proprietor VARCHAR(255) DEFAULT NULL, ADD card_number VARCHAR(50) DEFAULT NULL, ADD currency VARCHAR(20) DEFAULT NULL, ADD status INT NOT NULL, ADD date_created DATETIME NOT NULL, ADD agent_bank VARCHAR(100) DEFAULT NULL, ADD agent_agency VARCHAR(100) DEFAULT NULL, ADD agent_name VARCHAR(100) DEFAULT NULL, DROP titulaire_compte, DROP nom, DROP prenom, DROP date_naissance, DROP telephone, DROP type_document_identification, DROP is_document_identification, DROP numero_document_identification, DROP element_operation, DROP is_telephone_validator, CHANGE type_operation surname VARCHAR(100) DEFAULT NULL, CHANGE validite_document_identification date_birth DATE DEFAULT NULL');
        $this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1F07459E3 FOREIGN KEY (card_user_id) REFERENCES card_user (id)');
        $this->addSql('ALTER TABLE transaction ADD CONSTRAINT FK_723705D1C0FC7995 FOREIGN KEY (check_qr_id) REFERENCES check_qr (id)');
        $this->addSql('CREATE INDEX IDX_723705D1F07459E3 ON transaction (card_user_id)');
        $this->addSql('CREATE INDEX IDX_723705D1C0FC7995 ON transaction (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 transaction DROP FOREIGN KEY FK_723705D1F07459E3');
        $this->addSql('ALTER TABLE transaction DROP FOREIGN KEY FK_723705D1C0FC7995');
        $this->addSql('DROP INDEX IDX_723705D1F07459E3 ON transaction');
        $this->addSql('DROP INDEX IDX_723705D1C0FC7995 ON transaction');
        $this->addSql('ALTER TABLE transaction ADD titulaire_compte VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD nom VARCHAR(200) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD prenom VARCHAR(200) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD date_naissance DATE NOT NULL, ADD telephone VARCHAR(20) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, ADD type_document_identification VARCHAR(50) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD is_document_identification TINYINT(1) NOT NULL, ADD numero_document_identification VARCHAR(50) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD validite_document_identification DATE DEFAULT NULL, ADD element_operation VARCHAR(50) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, ADD is_telephone_validator TINYINT(1) NOT NULL, ADD type_operation VARCHAR(100) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, DROP card_user_id, DROP check_qr_id, DROP civility, DROP first_name, DROP surname, DROP date_birth, DROP phone, DROP phone2, DROP is_phone, DROP is_identificationdocument, DROP type_of_identification_document, DROP identification_document_number, DROP identification_document_validity, DROP type_of_operation, DROP domiciliation_institution, DROP account_type, DROP account_action, DROP amount, DROP account_proprietor, DROP account_number, DROP card_type, DROP card_action, DROP card_proprietor, DROP card_number, DROP currency, DROP status, DROP date_created, DROP agent_bank, DROP agent_agency, DROP agent_name');
    }
}
