<?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 Version20220607095752 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 bieres DROP FOREIGN KEY FK_EAD71EA5106BC3B7');
$this->addSql('DROP TABLE categorie_biere');
$this->addSql('DROP INDEX IDX_EAD71EA5106BC3B7 ON bieres');
$this->addSql('ALTER TABLE bieres ADD category_biere VARCHAR(255) DEFAULT NULL, DROP category_biere_id');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE categorie_biere (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE bieres ADD category_biere_id INT DEFAULT NULL, DROP category_biere');
$this->addSql('ALTER TABLE bieres ADD CONSTRAINT FK_EAD71EA5106BC3B7 FOREIGN KEY (category_biere_id) REFERENCES categorie_biere (id)');
$this->addSql('CREATE INDEX IDX_EAD71EA5106BC3B7 ON bieres (category_biere_id)');
}
}