<?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 Version20220117145742 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 shop_product_group_restriction_group DROP FOREIGN KEY FK_F7A9CCA84584665A');
$this->addSql('DROP TABLE shop_product_group_restriction');
$this->addSql('DROP TABLE shop_product_group_restriction_group');
$this->addSql('ALTER TABLE jobs_job_offer ADD enabled TINYINT(1) DEFAULT \'1\' NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE shop_product_group_restriction (product_id INT UNSIGNED NOT NULL, allowed TINYINT(1) DEFAULT \'0\' NOT NULL, PRIMARY KEY(product_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('CREATE TABLE shop_product_group_restriction_group (product_id INT UNSIGNED NOT NULL, group_id INT UNSIGNED NOT NULL, INDEX IDX_F7A9CCA84584665A (product_id), INDEX IDX_F7A9CCA8FE54D947 (group_id), PRIMARY KEY(product_id, group_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
$this->addSql('ALTER TABLE shop_product_group_restriction ADD CONSTRAINT FK_308C357F4584665A FOREIGN KEY (product_id) REFERENCES shop_product (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE shop_product_group_restriction_group ADD CONSTRAINT FK_F7A9CCA84584665A FOREIGN KEY (product_id) REFERENCES shop_product_group_restriction (product_id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE shop_product_group_restriction_group ADD CONSTRAINT FK_F7A9CCA8FE54D947 FOREIGN KEY (group_id) REFERENCES shop_group (id) ON UPDATE NO ACTION ON DELETE CASCADE');
$this->addSql('ALTER TABLE jobs_job_offer DROP enabled');
}
}