<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20250214155540 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE applicant ADD anonymized_by_id UUID DEFAULT NULL');
$this->addSql('ALTER TABLE applicant ADD pseudonimized_by_id UUID DEFAULT NULL');
$this->addSql('ALTER TABLE applicant ADD is_anonymized BOOLEAN DEFAULT false NOT NULL');
$this->addSql('ALTER TABLE applicant ADD is_pseudonimized BOOLEAN DEFAULT false NOT NULL');
$this->addSql('ALTER TABLE applicant ADD anonymized_at DATE DEFAULT NULL');
$this->addSql('ALTER TABLE applicant ADD pseudonimized_at DATE DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN applicant.anonymized_by_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN applicant.pseudonimized_by_id IS \'(DC2Type:uuid)\'');
$this->addSql('COMMENT ON COLUMN applicant.anonymized_at IS \'(DC2Type:date_immutable)\'');
$this->addSql('COMMENT ON COLUMN applicant.pseudonimized_at IS \'(DC2Type:date_immutable)\'');
$this->addSql('ALTER TABLE applicant ADD CONSTRAINT FK_CAAD1019E6B04A5D FOREIGN KEY (anonymized_by_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE applicant ADD CONSTRAINT FK_CAAD10195569790A FOREIGN KEY (pseudonimized_by_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_CAAD1019E6B04A5D ON applicant (anonymized_by_id)');
$this->addSql('CREATE INDEX IDX_CAAD10195569790A ON applicant (pseudonimized_by_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE applicant DROP CONSTRAINT FK_CAAD1019E6B04A5D');
$this->addSql('ALTER TABLE applicant DROP CONSTRAINT FK_CAAD10195569790A');
$this->addSql('DROP INDEX IDX_CAAD1019E6B04A5D');
$this->addSql('DROP INDEX IDX_CAAD10195569790A');
$this->addSql('ALTER TABLE applicant DROP anonymized_by_id');
$this->addSql('ALTER TABLE applicant DROP pseudonimized_by_id');
$this->addSql('ALTER TABLE applicant DROP is_anonymized');
$this->addSql('ALTER TABLE applicant DROP is_pseudonimized');
$this->addSql('ALTER TABLE applicant DROP anonymized_at');
$this->addSql('ALTER TABLE applicant DROP pseudonimized_at');
}
}