<?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 Version20250930101936 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 slug (id INT AUTO_INCREMENT NOT NULL, value VARCHAR(255) NOT NULL, canonical TINYINT(1) DEFAULT 0 NOT NULL, entity_type VARCHAR(100) NOT NULL, entity_id INT NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, updated_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_989D9B621D775834 (value), INDEX idx_slug_value (value), INDEX idx_slug_entity (entity_type, entity_id), INDEX idx_slug_canonical (canonical), PRIMARY KEY(id)) DEFAULT CHARACTER SET UTF8 COLLATE `UTF8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE destination ADD canonical VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE option_residence ADD canonical VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE promo ADD canonical VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE theme ADD canonical VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE slug');
$this->addSql('ALTER TABLE destination DROP canonical');
$this->addSql('ALTER TABLE option_residence DROP canonical');
$this->addSql('ALTER TABLE promo DROP canonical');
$this->addSql('ALTER TABLE theme DROP canonical');
}
}