<?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 Version20230620083746 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 filter_child (id INT AUTO_INCREMENT NOT NULL, filter_id INT NOT NULL, id_punch INT DEFAULT NULL, name VARCHAR(255) NOT NULL, deleted TINYINT(1) NOT NULL, updated_at DATETIME DEFAULT NULL, INDEX IDX_B02A7D6D395B25E (filter_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE filter_child_articles (filter_child_id INT NOT NULL, articles_id INT NOT NULL, INDEX IDX_ABD043C4E00DC7BB (filter_child_id), INDEX IDX_ABD043C41EBAF6CC (articles_id), PRIMARY KEY(filter_child_id, articles_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE filters (id INT AUTO_INCREMENT NOT NULL, id_punch INT DEFAULT NULL, name VARCHAR(255) NOT NULL, deleted TINYINT(1) NOT NULL, updated_at DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE filter_child ADD CONSTRAINT FK_B02A7D6D395B25E FOREIGN KEY (filter_id) REFERENCES filters (id)');
$this->addSql('ALTER TABLE filter_child_articles ADD CONSTRAINT FK_ABD043C4E00DC7BB FOREIGN KEY (filter_child_id) REFERENCES filter_child (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE filter_child_articles ADD CONSTRAINT FK_ABD043C41EBAF6CC FOREIGN KEY (articles_id) REFERENCES articles (id) ON DELETE CASCADE');
$this->addSql('ALTER TABLE article_order_out_of_stock ADD order_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE article_order_out_of_stock ADD CONSTRAINT FK_AA4BB1CA8D9F6D38 FOREIGN KEY (order_id) REFERENCES orders (id)');
$this->addSql('CREATE INDEX IDX_AA4BB1CA8D9F6D38 ON article_order_out_of_stock (order_id)');
$this->addSql('ALTER TABLE child_tags ADD id_punch INT DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE tag_groups ADD id_punch INT DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE users ADD new_password_token VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE filter_child DROP FOREIGN KEY FK_B02A7D6D395B25E');
$this->addSql('ALTER TABLE filter_child_articles DROP FOREIGN KEY FK_ABD043C4E00DC7BB');
$this->addSql('ALTER TABLE filter_child_articles DROP FOREIGN KEY FK_ABD043C41EBAF6CC');
$this->addSql('DROP TABLE filter_child');
$this->addSql('DROP TABLE filter_child_articles');
$this->addSql('DROP TABLE filters');
$this->addSql('ALTER TABLE article_order_out_of_stock DROP FOREIGN KEY FK_AA4BB1CA8D9F6D38');
$this->addSql('DROP INDEX IDX_AA4BB1CA8D9F6D38 ON article_order_out_of_stock');
$this->addSql('ALTER TABLE article_order_out_of_stock DROP order_id');
$this->addSql('ALTER TABLE child_tags DROP id_punch, DROP updated_at');
$this->addSql('ALTER TABLE tag_groups DROP id_punch, DROP updated_at');
$this->addSql('ALTER TABLE users DROP new_password_token');
}
}