<?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 Version20240424083626 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 discount_translation (id INT AUTO_INCREMENT NOT NULL, discount_id INT DEFAULT NULL, locale VARCHAR(255) NOT NULL, description VARCHAR(255) NOT NULL, sticky VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, INDEX IDX_F618B1574C7C611F (discount_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE discount_translation ADD CONSTRAINT FK_F618B1574C7C611F FOREIGN KEY (discount_id) REFERENCES discount (id)');
$this->addSql('ALTER TABLE discount ADD popup_seo_url_id INT DEFAULT NULL, ADD is_popup TINYINT(1) NOT NULL');
$this->addSql('ALTER TABLE discount ADD CONSTRAINT FK_E1E0B40E4002008B FOREIGN KEY (popup_seo_url_id) REFERENCES seo_page (id)');
$this->addSql('CREATE INDEX IDX_E1E0B40E4002008B ON discount (popup_seo_url_id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE discount_translation DROP FOREIGN KEY FK_F618B1574C7C611F');
$this->addSql('DROP TABLE discount_translation');
$this->addSql('ALTER TABLE discount DROP FOREIGN KEY FK_E1E0B40E4002008B');
$this->addSql('DROP INDEX IDX_E1E0B40E4002008B ON discount');
$this->addSql('ALTER TABLE discount DROP popup_seo_url_id, DROP is_popup');
}
}