<?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 Version20220610203614 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 ingredient ADD unit_id INT DEFAULT NULL, ADD show_unit TINYINT(1) DEFAULT NULL, ADD weight NUMERIC(10, 4) DEFAULT NULL, ADD kcal INT DEFAULT NULL, ADD gluten_free TINYINT(1) DEFAULT NULL, ADD vegetarian TINYINT(1) DEFAULT NULL, ADD vegan TINYINT(1) DEFAULT NULL, ADD lacto_free TINYINT(1) DEFAULT NULL, ADD protein INT DEFAULT NULL, ADD fats INT DEFAULT NULL, ADD carbohydrates INT DEFAULT NULL, ADD fiber INT DEFAULT NULL, ADD salt INT DEFAULT NULL, ADD unsaturated_fatty_acids INT DEFAULT NULL, ADD simple_sugars INT DEFAULT NULL, ADD glycemic_index INT DEFAULT NULL');
$this->addSql('ALTER TABLE ingredient ADD CONSTRAINT FK_6BAF7870F8BD700D FOREIGN KEY (unit_id) REFERENCES unit (id)');
$this->addSql('CREATE INDEX IDX_6BAF7870F8BD700D ON ingredient (unit_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE ingredient DROP FOREIGN KEY FK_6BAF7870F8BD700D');
$this->addSql('DROP INDEX IDX_6BAF7870F8BD700D ON ingredient');
$this->addSql('ALTER TABLE ingredient DROP unit_id, DROP show_unit, DROP weight, DROP kcal, DROP gluten_free, DROP vegetarian, DROP vegan, DROP lacto_free, DROP protein, DROP fats, DROP carbohydrates, DROP fiber, DROP salt, DROP unsaturated_fatty_acids, DROP simple_sugars, DROP glycemic_index');
}
}