migrations/Version20240201172808.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 Version20240201172808 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 scans_archive (
  19.             id VARCHAR(32) NOT NULL, 
  20.             target_id INT NOT NULL, 
  21.             project_id VARCHAR(64) NOT NULL, 
  22.             capture_date DATETIME NOT NULL, 
  23.             landing_page_url VARCHAR(2048) DEFAULT NULL, 
  24.             landing_path LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', 
  25.             more_info_link VARCHAR(2048) NOT NULL, 
  26.             screen_shot_url VARCHAR(2048) DEFAULT NULL, 
  27.             status INT NOT NULL, resolution INT DEFAULT NULL, 
  28.             multiple_monetization INT DEFAULT 0 NOT NULL, 
  29.             checksum VARCHAR(36) NOT NULL, 
  30.             created DATETIME NOT NULL, 
  31.             updated DATETIME NOT NULL, 
  32.             target_version INT NOT NULL, 
  33.             needs_retry TINYINT(1) DEFAULT 0 NOT NULL, 
  34.             scan_type INT DEFAULT 1 NOT NULL,
  35.             PRIMARY KEY(id)
  36.             ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
  37.         $this->addSql('ALTER TABLE scans_archive ADD CONSTRAINT FK_44A0993158E0B66 FOREIGN KEY (target_id) REFERENCES targets (id)');
  38.     }
  39.     public function down(Schema $schema): void
  40.     {
  41.         // this down() migration is auto-generated, please modify it to your needs
  42.         $this->addSql('ALTER TABLE scans_archive DROP FOREIGN KEY FK_44A0993158E0B66');
  43.         $this->addSql('DROP TABLE scans_archive');
  44.     }
  45. }