<?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 Version20220610161537 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('DROP TABLE fichier');
$this->addSql('ALTER TABLE format ADD background VARCHAR(255) DEFAULT NULL, ADD type VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE media CHANGE fichier fichier LONGTEXT DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE fichier (id INT AUTO_INCREMENT NOT NULL, media_id INT DEFAULT NULL, nom_original VARCHAR(255) CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, url LONGTEXT CHARACTER SET utf8mb4 DEFAULT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_9B76551FEA9FDD75 (media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE fichier ADD CONSTRAINT FK_9B76551FEA9FDD75 FOREIGN KEY (media_id) REFERENCES media (id)');
$this->addSql('ALTER TABLE format DROP background, DROP type');
$this->addSql('ALTER TABLE media CHANGE fichier fichier TEXT DEFAULT NULL');
}
}