<?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 Version20240201172808 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 scans_archive (
id VARCHAR(32) NOT NULL,
target_id INT NOT NULL,
project_id VARCHAR(64) NOT NULL,
capture_date DATETIME NOT NULL,
landing_page_url VARCHAR(2048) DEFAULT NULL,
landing_path LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\',
more_info_link VARCHAR(2048) NOT NULL,
screen_shot_url VARCHAR(2048) DEFAULT NULL,
status INT NOT NULL, resolution INT DEFAULT NULL,
multiple_monetization INT DEFAULT 0 NOT NULL,
checksum VARCHAR(36) NOT NULL,
created DATETIME NOT NULL,
updated DATETIME NOT NULL,
target_version INT NOT NULL,
needs_retry TINYINT(1) DEFAULT 0 NOT NULL,
scan_type INT DEFAULT 1 NOT NULL,
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE scans_archive ADD CONSTRAINT FK_44A0993158E0B66 FOREIGN KEY (target_id) REFERENCES targets (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE scans_archive DROP FOREIGN KEY FK_44A0993158E0B66');
$this->addSql('DROP TABLE scans_archive');
}
}