<?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 Version20240115210134 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('INSERT INTO tag_scan (tag_type, scan_id) SELECT DISTINCT 1, s.id
FROM scans s, targets t WHERE s.target_id = t.id AND t.type_id IN (4, 5);');
$this->addSql('INSERT INTO tag_scan (tag_type, scan_id) SELECT DISTINCT 2, s.id
FROM scans s, targets t WHERE s.target_id = t.id AND t.type_id IN (0, 1, 2, 3);');
$this->addSql("INSERT INTO tag_scan (tag_type, scan_id) SELECT DISTINCT 3, s.id
FROM scans s, alerts a WHERE a.scan_id = s.id AND a.alert_id = 'ed3c9d15f8c7952f64d9675a4c66f750';");
}
public function down(Schema $schema): void
{
$this->addSql('DELETE FROM tag_scan;');
}
}