chill-bundles/src/Bundle/ChillMainBundle/migrations/Version20241205140905.php
Julien Fastré 1b65cac1df
Make person phone number nullable
Removed the "not null" constraint from the person phone number field to allow for better flexibility in data storage, such as storing notes. This change rectifies issues in certain instances where the migration had incorrectly set the field to "not null". Adjustments include updating the database schema and modifying the entity definition to reflect this change.
2024-12-05 15:30:25 +01:00

33 lines
872 B
PHP

<?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\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241205140905 extends AbstractMigration
{
public function getDescription(): string
{
return 'Restore the nullable person phone, as this is used by comments';
}
public function up(Schema $schema): void
{
// this should be already not null, but helps some instances, where a migration which drop not null
// was executed, and was wrong.
$this->addSql('ALTER TABLE chill_person_phone ALTER phonenumber DROP NOT NULL');
}
public function down(Schema $schema): void {}
}