<?php
/* @noinspection PhpUnused */
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*
* @package API
* @author
* @internal
*/
final class Version20250409085325 extends AbstractMigration
{
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE sob_record DROP FOREIGN KEY FK_108B18328C03F15C');
$this->addSql('ALTER TABLE sob_record DROP FOREIGN KEY FK_108B1832F92F3E70');
$this->addSql('ALTER TABLE sob_record DROP FOREIGN KEY FK_108B18323E859F62');
$this->addSql('DROP TABLE sob_record');
}
public function getDescription(): string
{
return
"- Introduces sob_record table.";
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql(
'
CREATE TABLE sob_record (
id INT AUTO_INCREMENT NOT NULL COMMENT \'Internal ID\',
employee_id INT NOT NULL COMMENT \'Internal ID\',
country_id VARCHAR(2) DEFAULT NULL COMMENT \'Country code in upper case (ISO 3166-1 Alpha-2)\',
address VARCHAR(225) DEFAULT NULL COMMENT \'Optional social consultant address\',
zip_code VARCHAR(16) DEFAULT NULL COMMENT \'Optional social consultant zip code\',
city VARCHAR(225) DEFAULT NULL COMMENT \'Optional social consultant city\',
phone VARCHAR(225) DEFAULT NULL COMMENT \'Optional phone number\',
lock_status_reason VARCHAR(225) DEFAULT \'ENTITY_CREATED\' NOT NULL
COMMENT \'Lock status reason for the record\',
employee_consent_confirmation_user_id INT DEFAULT NULL COMMENT \'Internal ID\',
employee_consent_confirmation_date DATE DEFAULT NULL COMMENT \'Employee consent confirmation date.\',
created INT NOT NULL COMMENT \'Entity creation date as UNIX timestamp\',
active SMALLINT DEFAULT 1 NOT NULL COMMENT \'Indicator if entity is active\',
last_active_date DATE DEFAULT NULL COMMENT \'Last active date\',
updated INT DEFAULT NULL COMMENT \'Entity update date as UNIX timestamp\',
UNIQUE INDEX UNIQ_108B18328C03F15C (employee_id),
INDEX IDX_108B1832F92F3E70 (country_id),
INDEX IDX_108B18323E859F62 (employee_consent_confirmation_user_id),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
'
);
$this->addSql(
'
ALTER TABLE sob_record ADD CONSTRAINT FK_108B18328C03F15C
FOREIGN KEY (employee_id) REFERENCES employee (id);
'
);
$this->addSql(
'
ALTER TABLE sob_record ADD CONSTRAINT FK_108B1832F92F3E70
FOREIGN KEY (country_id) REFERENCES country (id) ON DELETE SET NULL;
'
);
$this->addSql(
'
ALTER TABLE sob_record ADD CONSTRAINT FK_108B18323E859F62
FOREIGN KEY (employee_consent_confirmation_user_id) REFERENCES user (id);
'
);
}
}