<?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 Version20230418130317 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 user_file_bank_account (id INT AUTO_INCREMENT NOT NULL, user_file_id INT DEFAULT NULL, date_add DATETIME NOT NULL, date_update DATETIME NOT NULL, type VARCHAR(255) DEFAULT NULL, person VARCHAR(255) DEFAULT NULL, entity_name VARCHAR(255) DEFAULT NULL, unique_identifier VARCHAR(255) DEFAULT NULL, open_date DATE DEFAULT NULL, close_date DATE DEFAULT NULL, INDEX IDX_8233EABCBC66766 (user_file_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE user_file_bank_account ADD CONSTRAINT FK_8233EABCBC66766 FOREIGN KEY (user_file_id) REFERENCES user_file (id)');
$this->addSql('ALTER TABLE user_file_answer ADD user_file_bank_account_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user_file_answer ADD CONSTRAINT FK_CBD1A50F50CE1DB6 FOREIGN KEY (user_file_bank_account_id) REFERENCES user_file_bank_account (id)');
$this->addSql('CREATE INDEX IDX_CBD1A50F50CE1DB6 ON user_file_answer (user_file_bank_account_id)');
$this->addSql('ALTER TABLE user_file_document_group ADD user_file_bank_account_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user_file_document_group ADD CONSTRAINT FK_B37DE49E50CE1DB6 FOREIGN KEY (user_file_bank_account_id) REFERENCES user_file_bank_account (id)');
$this->addSql('CREATE INDEX IDX_B37DE49E50CE1DB6 ON user_file_document_group (user_file_bank_account_id)');
$this->addSql('ALTER TABLE user_file_investment ADD user_file_person_id INT DEFAULT NULL, CHANGE user_file_id user_file_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user_file_investment ADD CONSTRAINT FK_E8FEBDEFC4F1DB68 FOREIGN KEY (user_file_person_id) REFERENCES user_file_person (id)');
$this->addSql('CREATE INDEX IDX_E8FEBDEFC4F1DB68 ON user_file_investment (user_file_person_id)');
$this->addSql('ALTER TABLE user_file_missing_files ADD user_file_bank_account_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE user_file_missing_files ADD CONSTRAINT FK_6E1B485750CE1DB6 FOREIGN KEY (user_file_bank_account_id) REFERENCES user_file_bank_account (id)');
$this->addSql('CREATE INDEX IDX_6E1B485750CE1DB6 ON user_file_missing_files (user_file_bank_account_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user_file_answer DROP FOREIGN KEY FK_CBD1A50F50CE1DB6');
$this->addSql('ALTER TABLE user_file_document_group DROP FOREIGN KEY FK_B37DE49E50CE1DB6');
$this->addSql('ALTER TABLE user_file_missing_files DROP FOREIGN KEY FK_6E1B485750CE1DB6');
$this->addSql('ALTER TABLE user_file_bank_account DROP FOREIGN KEY FK_8233EABCBC66766');
$this->addSql('DROP TABLE user_file_bank_account');
$this->addSql('DROP INDEX IDX_CBD1A50F50CE1DB6 ON user_file_answer');
$this->addSql('ALTER TABLE user_file_answer DROP user_file_bank_account_id');
$this->addSql('DROP INDEX IDX_B37DE49E50CE1DB6 ON user_file_document_group');
$this->addSql('ALTER TABLE user_file_document_group DROP user_file_bank_account_id');
$this->addSql('ALTER TABLE user_file_investment DROP FOREIGN KEY FK_E8FEBDEFC4F1DB68');
$this->addSql('DROP INDEX IDX_E8FEBDEFC4F1DB68 ON user_file_investment');
$this->addSql('ALTER TABLE user_file_investment DROP user_file_person_id, CHANGE user_file_id user_file_id INT NOT NULL');
$this->addSql('DROP INDEX IDX_6E1B485750CE1DB6 ON user_file_missing_files');
$this->addSql('ALTER TABLE user_file_missing_files DROP user_file_bank_account_id');
}
}