migrations/Version20240528134434.php line 1

  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 Version20240528134434 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 comment (id INT AUTO_INCREMENT NOT NULL, artivle_id INT NOT NULL, INDEX IDX_9474526C218F15B4 (artivle_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  19.         $this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526C218F15B4 FOREIGN KEY (artivle_id) REFERENCES search_campaign (id)');
  20.     }
  21.     public function down(Schema $schema): void
  22.     {
  23.         // this down() migration is auto-generated, please modify it to your needs
  24.         $this->addSql('ALTER TABLE comment DROP FOREIGN KEY FK_9474526C218F15B4');
  25.         $this->addSql('DROP TABLE comment');
  26.         $this->addSql('ALTER TABLE app_bundle CHANGE geo geo JSON DEFAULT NULL');
  27.         $this->addSql('ALTER TABLE campaign CHANGE browser browser JSON NOT NULL');
  28.         $this->addSql('ALTER TABLE device CHANGE browser browser VARCHAR(255) DEFAULT NULL, CHANGE view_port_width view_port_width INT DEFAULT NULL, CHANGE view_port_height view_port_height INT DEFAULT NULL, CHANGE json json JSON DEFAULT NULL, CHANGE platform platform VARCHAR(255) DEFAULT NULL, CHANGE ram ram INT DEFAULT NULL, CHANGE cores cores INT DEFAULT NULL, CHANGE gpu_vendor gpu_vendor VARCHAR(255) DEFAULT NULL, CHANGE gpu_renderer gpu_renderer VARCHAR(255) DEFAULT NULL');
  29.         $this->addSql('ALTER TABLE host CHANGE expire expire DATE DEFAULT NULL');
  30.         $this->addSql('ALTER TABLE search_campaign ADD company VARCHAR(255) DEFAULT NULL');
  31.         $this->addSql('ALTER TABLE search_feed ADD global_timeout INT DEFAULT NULL');
  32.         $this->addSql('ALTER TABLE search_feed_timeouts CHANGE count count DOUBLE PRECISION DEFAULT NULL');
  33.     }
  34. }