migrations/Version20230213013038.php line 1
<?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 Version20230213013038 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 nft_queue DROP FOREIGN KEY FK_380C21C0A76ED395');
$this->addSql('DROP INDEX UNIQ_380C21C0A76ED395 ON nft_queue');
$this->addSql('ALTER TABLE nft_queue DROP user_id');
$this->addSql('ALTER TABLE recipe DROP FOREIGN KEY FK_DA88B1375DA0FB8');
$this->addSql('DROP INDEX UNIQ_DA88B1375DA0FB8 ON recipe');
$this->addSql('ALTER TABLE recipe DROP template_id');
$this->addSql('ALTER TABLE template ADD recipe_id INT');
$this->addSql('ALTER TABLE template ADD CONSTRAINT FK_97601F8359D8A214 FOREIGN KEY (recipe_id) REFERENCES recipe (id)');
$this->addSql('CREATE UNIQUE INDEX UNIQ_97601F8359D8A214 ON template (recipe_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE nft_queue ADD user_id INT NOT NULL');
$this->addSql('ALTER TABLE nft_queue ADD CONSTRAINT FK_380C21C0A76ED395 FOREIGN KEY (user_id) REFERENCES user (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE UNIQUE INDEX UNIQ_380C21C0A76ED395 ON nft_queue (user_id)');
$this->addSql('ALTER TABLE recipe ADD template_id INT NOT NULL');
$this->addSql('ALTER TABLE recipe ADD CONSTRAINT FK_DA88B1375DA0FB8 FOREIGN KEY (template_id) REFERENCES template (id) ON UPDATE NO ACTION ON DELETE NO ACTION');
$this->addSql('CREATE UNIQUE INDEX UNIQ_DA88B1375DA0FB8 ON recipe (template_id)');
$this->addSql('ALTER TABLE template DROP FOREIGN KEY FK_97601F8359D8A214');
$this->addSql('DROP INDEX UNIQ_97601F8359D8A214 ON template');
$this->addSql('ALTER TABLE template DROP recipe_id');
}
}