<?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 Version20250109101107 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 aeat_customer_data (id INT AUTO_INCREMENT NOT NULL, customer_id INT NOT NULL, date_birth DATE DEFAULT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, document_type INT NOT NULL, document_number VARCHAR(255) DEFAULT NULL, document_number_support VARCHAR(255) DEFAULT NULL, document_number_virtual VARCHAR(255) DEFAULT NULL, document_date_valid DATE DEFAULT NULL, UNIQUE INDEX UNIQ_7449C75AD1B862B8 (hash), UNIQUE INDEX UNIQ_7449C75A9395C3F3 (customer_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE aeat_customer_data_model (id INT AUTO_INCREMENT NOT NULL, customer_data_id INT NOT NULL, model_type_id INT DEFAULT NULL, year INT NOT NULL, json JSON DEFAULT NULL, casilla_505 VARCHAR(255) DEFAULT NULL, session_id VARCHAR(255) NOT NULL, hash VARCHAR(255) NOT NULL, status INT NOT NULL, is_removed TINYINT(1) NOT NULL, cdate DATETIME NOT NULL, mdate DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_1E695624D1B862B8 (hash), INDEX IDX_1E6956242B280582 (customer_data_id), INDEX IDX_1E695624A5DFE562 (model_type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE aeat_customer_data_model_type (id INT AUTO_INCREMENT NOT NULL, alias VARCHAR(20) NOT NULL, title VARCHAR(255) NOT NULL, hash VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_989B31F8E16C6B94 (alias), UNIQUE INDEX UNIQ_989B31F8D1B862B8 (hash), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE aeat_customer_data ADD CONSTRAINT FK_7449C75A9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id)');
$this->addSql('ALTER TABLE aeat_customer_data_model ADD CONSTRAINT FK_1E6956242B280582 FOREIGN KEY (customer_data_id) REFERENCES aeat_customer_data (id)');
$this->addSql('ALTER TABLE aeat_customer_data_model ADD CONSTRAINT FK_1E695624A5DFE562 FOREIGN KEY (model_type_id) REFERENCES aeat_customer_data_model_type (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE aeat_customer_data DROP FOREIGN KEY FK_7449C75A9395C3F3');
$this->addSql('ALTER TABLE aeat_customer_data_model DROP FOREIGN KEY FK_1E6956242B280582');
$this->addSql('ALTER TABLE aeat_customer_data_model DROP FOREIGN KEY FK_1E695624A5DFE562');
$this->addSql('DROP TABLE aeat_customer_data');
$this->addSql('DROP TABLE aeat_customer_data_model');
$this->addSql('DROP TABLE aeat_customer_data_model_type');
}
}