<?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 Version20220608124137 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 salades_price_quantity (salades_id INT NOT NULL, price_quantity_id INT NOT NULL, INDEX IDX_ADB10BB63D54978E (salades_id), INDEX IDX_ADB10BB6795206EA (price_quantity_id), PRIMARY KEY(salades_id, price_quantity_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE salades_price_quantity ADD CONSTRAINT FK_ADB10BB63D54978E FOREIGN KEY (salades_id) REFERENCES salades (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE salades_price_quantity ADD CONSTRAINT FK_ADB10BB6795206EA FOREIGN KEY (price_quantity_id) REFERENCES price_quantity (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE entree ADD category_id INT DEFAULT NULL, CHANGE nom name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE entree ADD CONSTRAINT FK_598377A612469DE2 FOREIGN KEY (category_id) REFERENCES categories (id)');
$this->addSql('CREATE INDEX IDX_598377A612469DE2 ON entree (category_id)');
$this->addSql('ALTER TABLE gratins ADD category_id INT DEFAULT NULL, CHANGE nom name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE gratins ADD CONSTRAINT FK_A0ECFEE912469DE2 FOREIGN KEY (category_id) REFERENCES categories (id)');
$this->addSql('CREATE INDEX IDX_A0ECFEE912469DE2 ON gratins (category_id)');
$this->addSql('ALTER TABLE pates ADD category_id INT DEFAULT NULL, CHANGE nom name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE pates ADD CONSTRAINT FK_3E14F85C12469DE2 FOREIGN KEY (category_id) REFERENCES categories (id)');
$this->addSql('CREATE INDEX IDX_3E14F85C12469DE2 ON pates (category_id)');
$this->addSql('ALTER TABLE pizzas ADD category_id INT DEFAULT NULL, CHANGE nom name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE pizzas ADD CONSTRAINT FK_C6CC6E4012469DE2 FOREIGN KEY (category_id) REFERENCES categories (id)');
$this->addSql('CREATE INDEX IDX_C6CC6E4012469DE2 ON pizzas (category_id)');
$this->addSql('ALTER TABLE poissons ADD category_id INT DEFAULT NULL, CHANGE nom name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE poissons ADD CONSTRAINT FK_2D7653B812469DE2 FOREIGN KEY (category_id) REFERENCES categories (id)');
$this->addSql('CREATE INDEX IDX_2D7653B812469DE2 ON poissons (category_id)');
$this->addSql('ALTER TABLE salades ADD category_id INT DEFAULT NULL, CHANGE nom name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE salades ADD CONSTRAINT FK_C2441F8512469DE2 FOREIGN KEY (category_id) REFERENCES categories (id)');
$this->addSql('CREATE INDEX IDX_C2441F8512469DE2 ON salades (category_id)');
$this->addSql('ALTER TABLE viandes ADD category_id INT DEFAULT NULL, CHANGE nom name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE viandes ADD CONSTRAINT FK_DCDC66A812469DE2 FOREIGN KEY (category_id) REFERENCES categories (id)');
$this->addSql('CREATE INDEX IDX_DCDC66A812469DE2 ON viandes (category_id)');
$this->addSql('ALTER TABLE vins_au_verre DROP FOREIGN KEY FK_40AE7B0812469DE2');
$this->addSql('ALTER TABLE vins_au_verre ADD name VARCHAR(255) DEFAULT NULL, ADD brand VARCHAR(255) DEFAULT NULL, ADD type VARCHAR(255) NOT NULL, DROP nom, DROP sous_nom');
$this->addSql('ALTER TABLE vins_au_verre ADD CONSTRAINT FK_40AE7B0812469DE2 FOREIGN KEY (category_id) REFERENCES categories (id)');
$this->addSql('ALTER TABLE vins_pb ADD type VARCHAR(255) NOT NULL, CHANGE sous_nom brand VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE salades_price_quantity');
$this->addSql('ALTER TABLE entree DROP FOREIGN KEY FK_598377A612469DE2');
$this->addSql('DROP INDEX IDX_598377A612469DE2 ON entree');
$this->addSql('ALTER TABLE entree DROP category_id, CHANGE name nom VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE gratins DROP FOREIGN KEY FK_A0ECFEE912469DE2');
$this->addSql('DROP INDEX IDX_A0ECFEE912469DE2 ON gratins');
$this->addSql('ALTER TABLE gratins DROP category_id, CHANGE name nom VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE pates DROP FOREIGN KEY FK_3E14F85C12469DE2');
$this->addSql('DROP INDEX IDX_3E14F85C12469DE2 ON pates');
$this->addSql('ALTER TABLE pates DROP category_id, CHANGE name nom VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE pizzas DROP FOREIGN KEY FK_C6CC6E4012469DE2');
$this->addSql('DROP INDEX IDX_C6CC6E4012469DE2 ON pizzas');
$this->addSql('ALTER TABLE pizzas DROP category_id, CHANGE name nom VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE poissons DROP FOREIGN KEY FK_2D7653B812469DE2');
$this->addSql('DROP INDEX IDX_2D7653B812469DE2 ON poissons');
$this->addSql('ALTER TABLE poissons DROP category_id, CHANGE name nom VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE salades DROP FOREIGN KEY FK_C2441F8512469DE2');
$this->addSql('DROP INDEX IDX_C2441F8512469DE2 ON salades');
$this->addSql('ALTER TABLE salades DROP category_id, CHANGE name nom VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE viandes DROP FOREIGN KEY FK_DCDC66A812469DE2');
$this->addSql('DROP INDEX IDX_DCDC66A812469DE2 ON viandes');
$this->addSql('ALTER TABLE viandes DROP category_id, CHANGE name nom VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE vins_au_verre DROP FOREIGN KEY FK_40AE7B0812469DE2');
$this->addSql('ALTER TABLE vins_au_verre ADD nom VARCHAR(255) DEFAULT NULL, ADD sous_nom VARCHAR(255) DEFAULT NULL, DROP name, DROP brand, DROP type');
$this->addSql('ALTER TABLE vins_au_verre ADD CONSTRAINT FK_40AE7B0812469DE2 FOREIGN KEY (category_id) REFERENCES categorie_vin (id)');
$this->addSql('ALTER TABLE vins_pb DROP type, CHANGE brand sous_nom VARCHAR(255) DEFAULT NULL');
}
}