<?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 Version20241011120738 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 marketing_show_case (id INT AUTO_INCREMENT NOT NULL, hotel_category_id INT DEFAULT NULL, tour_category_id INT DEFAULT NULL, site_id INT DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, sequence INT NOT NULL, INDEX IDX_E45DE8D2CC88D7CD (hotel_category_id), INDEX IDX_E45DE8D27210CF21 (tour_category_id), INDEX IDX_E45DE8D2F6BD1646 (site_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE marketing_show_case ADD CONSTRAINT FK_E45DE8D2CC88D7CD FOREIGN KEY (hotel_category_id) REFERENCES hotel_category (id)');
$this->addSql('ALTER TABLE marketing_show_case ADD CONSTRAINT FK_E45DE8D27210CF21 FOREIGN KEY (tour_category_id) REFERENCES tour_category (id)');
$this->addSql('ALTER TABLE marketing_show_case ADD CONSTRAINT FK_E45DE8D2F6BD1646 FOREIGN KEY (site_id) REFERENCES sites (id)');
$this->addSql('ALTER TABLE image ADD marketing_show_case_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE image ADD CONSTRAINT FK_C53D045F6B317027 FOREIGN KEY (marketing_show_case_id) REFERENCES marketing_show_case (id)');
$this->addSql('CREATE INDEX IDX_C53D045F6B317027 ON image (marketing_show_case_id)');
$this->addSql('ALTER TABLE tour_price CHANGE discount_type discount_type TINYINT(1) DEFAULT 0 NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE image DROP FOREIGN KEY FK_C53D045F6B317027');
$this->addSql('ALTER TABLE marketing_show_case DROP FOREIGN KEY FK_E45DE8D2CC88D7CD');
$this->addSql('ALTER TABLE marketing_show_case DROP FOREIGN KEY FK_E45DE8D27210CF21');
$this->addSql('ALTER TABLE marketing_show_case DROP FOREIGN KEY FK_E45DE8D2F6BD1646');
$this->addSql('DROP TABLE marketing_show_case');
$this->addSql('DROP INDEX IDX_C53D045F6B317027 ON image');
$this->addSql('ALTER TABLE image DROP marketing_show_case_id');
$this->addSql('ALTER TABLE tour_price CHANGE discount_type discount_type TINYINT(1) NOT NULL');
}
}