<?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 Version20250124112506 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 ransomware (id INT AUTO_INCREMENT NOT NULL, domain_id INT NOT NULL, detected_at DATETIME NOT NULL, location LONGTEXT NOT NULL, fragment LONGTEXT NOT NULL, network VARCHAR(255) NOT NULL, body LONGTEXT NOT NULL, title LONGTEXT NOT NULL, uri LONGTEXT NOT NULL, url LONGTEXT NOT NULL, file_size INT NOT NULL, domain_name VARCHAR(255) NOT NULL, ip VARCHAR(255) NOT NULL, snippet LONGTEXT NOT NULL, document_id VARCHAR(255) NOT NULL, languages LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', emails LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', ssns LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', ccns LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', ips LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', cryptos LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', headers LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', created_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', updated_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', UNIQUE INDEX UNIQ_45E369E9C33F7837 (document_id), INDEX IDX_45E369E9115F0EE5 (domain_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE ransomware ADD CONSTRAINT FK_45E369E9115F0EE5 FOREIGN KEY (domain_id) REFERENCES domain (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE ransomware DROP FOREIGN KEY FK_45E369E9115F0EE5');
$this->addSql('DROP TABLE ransomware');
}
}