migrations/Version20230417204304.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 Version20230417204304 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('ALTER TABLE event ADD published TINYINT(1) DEFAULT NULL, CHANGE title title VARCHAR(255) NOT NULL, CHANGE cost cost NUMERIC(10, 0) DEFAULT NULL');
  19.         $this->addSql('CREATE UNIQUE INDEX UNIQ_3BAE0AA72B36786B ON event (title)');
  20.         $this->addSql('CREATE UNIQUE INDEX UNIQ_3BAE0AA7989D9B62 ON event (slug)');
  21.         $this->addSql('ALTER TABLE news ADD published TINYINT(1) DEFAULT NULL, CHANGE title title VARCHAR(255) NOT NULL');
  22.         $this->addSql('CREATE UNIQUE INDEX UNIQ_1DD399502B36786B ON news (title)');
  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 INDEX UNIQ_3BAE0AA72B36786B ON `event`');
  28.         $this->addSql('DROP INDEX UNIQ_3BAE0AA7989D9B62 ON `event`');
  29.         $this->addSql('ALTER TABLE `event` DROP published, CHANGE title title LONGTEXT NOT NULL, CHANGE cost cost VARCHAR(50) DEFAULT NULL');
  30.         $this->addSql('DROP INDEX UNIQ_1DD399502B36786B ON news');
  31.         $this->addSql('ALTER TABLE news DROP published, CHANGE title title LONGTEXT NOT NULL');
  32.     }
  33. }