migrations/Version20250930101936.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20250930101936 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $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');
  19.         $this->addSql('ALTER TABLE destination ADD canonical VARCHAR(255) DEFAULT NULL');
  20.         $this->addSql('ALTER TABLE option_residence ADD canonical VARCHAR(255) DEFAULT NULL');
  21.         $this->addSql('ALTER TABLE promo ADD canonical VARCHAR(255) DEFAULT NULL');
  22.         $this->addSql('ALTER TABLE theme ADD canonical VARCHAR(255) DEFAULT NULL');
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         // this down() migration is auto-generated, please modify it to your needs
  27.         $this->addSql('DROP TABLE slug');
  28.         $this->addSql('ALTER TABLE destination DROP canonical');
  29.         $this->addSql('ALTER TABLE option_residence DROP canonical');
  30.         $this->addSql('ALTER TABLE promo DROP canonical');
  31.         $this->addSql('ALTER TABLE theme DROP canonical');
  32.     }
  33. }