chore: update ENTITY_HANDLE_BLACKLIST

This commit is contained in:
Maël Gangloff 2025-08-11 14:15:43 +02:00
parent 531a929c3b
commit e270a3d970
No known key found for this signature in database
GPG Key ID: 11FDC81C24A7F629
2 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,59 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use App\Service\RDAPService;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250811115400 extends AbstractMigration
{
public function getDescription(): string
{
return 'Remove blacklisted entities from database';
}
public function up(Schema $schema): void
{
$handlesList = implode(
', ',
array_map(fn ($h) => "'".addslashes($h)."'", RDAPService::ENTITY_HANDLE_BLACKLIST)
);
$this->addSql("
DELETE FROM entity_event
WHERE entity_uid IN (
SELECT id FROM entity WHERE handle IN ($handlesList)
)
");
$this->addSql("
DELETE FROM domain_entity
WHERE entity_uid IN (
SELECT id FROM entity WHERE handle IN ($handlesList)
)
");
$this->addSql("
DELETE FROM nameserver_entity
WHERE entity_uid IN (
SELECT id FROM entity WHERE handle IN ($handlesList)
)
");
$this->addSql("
DELETE FROM entity
WHERE handle IN ($handlesList)
");
}
public function down(Schema $schema): void
{
$this->write('Cannot restore deleted entities');
}
}

View File

@ -80,10 +80,14 @@ readonly class RDAPService
'ANO00-FRNIC',
'not applicable',
'REDACTED FOR PRIVACY-REGISTRANT',
'REDACTED FOR PRIVACY-TECH',
'REDACTED FOR PRIVACY',
'REDACTED-SIDN',
'REGISTRANT',
'REGISTRAR',
'ABUSE-CONTACT',
'None',
'Private',
];
/* @see https://www.iana.org/assignments/registrar-ids/registrar-ids.xhtml */