<?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 Version20231220162004 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 menucategory_role DROP FOREIGN KEY FK_F9AB632150A0D948');
$this->addSql('ALTER TABLE menucategory_role DROP FOREIGN KEY FK_F9AB6321FE54D947');
$this->addSql('ALTER TABLE menucategory_role ADD CONSTRAINT FK_F9AB632150A0D948 FOREIGN KEY (menucategory_id) REFERENCES menu_category (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE menucategory_role ADD CONSTRAINT FK_F9AB6321FE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE menucategoryitem_role DROP FOREIGN KEY FK_931D84C12107D70D');
$this->addSql('ALTER TABLE menucategoryitem_role DROP FOREIGN KEY FK_931D84C1FE54D947');
$this->addSql('ALTER TABLE menucategoryitem_role ADD CONSTRAINT FK_931D84C12107D70D FOREIGN KEY (menucategoryitem_id) REFERENCES menu_category_item (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE menucategoryitem_role ADD CONSTRAINT FK_931D84C1FE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE menucategory_role DROP FOREIGN KEY FK_F9AB632150A0D948');
$this->addSql('ALTER TABLE menucategory_role DROP FOREIGN KEY FK_F9AB6321FE54D947');
$this->addSql('ALTER TABLE menucategory_role ADD CONSTRAINT FK_F9AB632150A0D948 FOREIGN KEY (menucategory_id) REFERENCES menu_category (id)');
$this->addSql('ALTER TABLE menucategory_role ADD CONSTRAINT FK_F9AB6321FE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id)');
$this->addSql('ALTER TABLE menucategoryitem_role DROP FOREIGN KEY FK_931D84C12107D70D');
$this->addSql('ALTER TABLE menucategoryitem_role DROP FOREIGN KEY FK_931D84C1FE54D947');
$this->addSql('ALTER TABLE menucategoryitem_role ADD CONSTRAINT FK_931D84C12107D70D FOREIGN KEY (menucategoryitem_id) REFERENCES menu_category_item (id)');
$this->addSql('ALTER TABLE menucategoryitem_role ADD CONSTRAINT FK_931D84C1FE54D947 FOREIGN KEY (group_id) REFERENCES user_group (id)');
}
}