Refactor PersonIdentifierDefinition: Replace fully qualified \Doctrine\DBAL\Types\Types references with simplified Types aliases.

This commit is contained in:
2025-09-18 12:09:06 +02:00
parent b6145b2e5f
commit f3f914ca75
7 changed files with 107 additions and 22 deletions

View File

@@ -0,0 +1,37 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\Person;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20250918095044 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add more details about presence in PersonIdentifier';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_person_identifier_definition ADD presence VARCHAR(255) DEFAULT \'ON_EDIT\' NOT NULL');
$this->addSql('UPDATE chill_person_identifier_definition SET presence = \'NOT_EDITABLE\' WHERE is_editable_by_users IS FALSE');
$this->addSql('ALTER TABLE chill_person_identifier_definition DROP is_editable_by_users');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_person_identifier_definition ADD is_editable_by_users BOOLEAN DEFAULT false NOT NULL');
$this->addSql('UPDATE chill_person_identifier_definition SET is_editable_by_users = true WHERE presence <> \'NOT_EDITABLE\' ');
$this->addSql('ALTER TABLE chill_person_identifier_definition DROP presence');
}
}