<?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 Version20230223160734 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 media_object_news_item_user (id INT AUTO_INCREMENT NOT NULL, news_item_user_id INT DEFAULT NULL, file_path VARCHAR(255) DEFAULT NULL, creation_date DATETIME NOT NULL, file_key VARCHAR(255) DEFAULT NULL, INDEX IDX_B1408B0D4A799C76 (news_item_user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE media_object_news_item_user ADD CONSTRAINT FK_B1408B0D4A799C76 FOREIGN KEY (news_item_user_id) REFERENCES news_item_user (id)');
$this->addSql('ALTER TABLE news_item_user ADD dni VARCHAR(255) DEFAULT NULL, ADD nationality VARCHAR(255) DEFAULT NULL, ADD birth_date DATETIME DEFAULT NULL, ADD born_place VARCHAR(255) DEFAULT NULL, ADD address VARCHAR(255) DEFAULT NULL, ADD locality VARCHAR(255) DEFAULT NULL, ADD province VARCHAR(255) DEFAULT NULL, ADD main_title VARCHAR(255) DEFAULT NULL, ADD country VARCHAR(255) DEFAULT NULL, ADD course_place VARCHAR(255) DEFAULT NULL, ADD created_at DATETIME DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE media_object_news_item_user');
$this->addSql('ALTER TABLE news_item_user DROP dni, DROP nationality, DROP birth_date, DROP born_place, DROP address, DROP locality, DROP province, DROP main_title, DROP country, DROP course_place, DROP created_at');
}
}