<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230118140013 extends AbstractMigration
{
public function getDescription(): string
{
return 'add company_name, common_company_identifier and identity_files properties to agent table';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE agent ADD company_name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE agent ADD common_company_identifier VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE identity_verification_image ADD agent_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE identity_verification_image ADD CONSTRAINT FK_E05364D53414710B FOREIGN KEY (agent_id) REFERENCES agent (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_E05364D53414710B ON identity_verification_image (agent_id)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE abstract_collaborator ADD company_name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE agent DROP company_name');
$this->addSql('ALTER TABLE agent DROP common_company_identifier');
$this->addSql('ALTER TABLE identity_verification_image DROP CONSTRAINT FK_E05364D53414710B');
$this->addSql('DROP INDEX IDX_E05364D53414710B');
$this->addSql('ALTER TABLE identity_verification_image DROP agent_id');
}
}