mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 17:44:58 +00:00
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.
This commit is contained in:
@@ -20,7 +20,6 @@ use libphonenumber\PhoneNumber;
|
||||
#[ORM\Entity]
|
||||
#[ORM\Table(name: 'chill_person_phone')]
|
||||
#[ORM\Index(name: 'phonenumber', columns: ['phonenumber'])]
|
||||
#[ORM\Index(name: 'phonenumber', columns: ['phonenumber'])]
|
||||
class PersonPhone
|
||||
{
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::DATETIME_MUTABLE, nullable: false)]
|
||||
@@ -37,7 +36,12 @@ class PersonPhone
|
||||
#[ORM\ManyToOne(targetEntity: Person::class, inversedBy: 'otherPhoneNumbers')]
|
||||
private Person $person;
|
||||
|
||||
#[ORM\Column(type: 'phone_number', nullable: false)]
|
||||
/**
|
||||
* The phonenumber.
|
||||
*
|
||||
* This phonenumber is nullable: this allow user to store some notes instead of a phonenumber
|
||||
*/
|
||||
#[ORM\Column(type: 'phone_number', nullable: true)]
|
||||
private ?PhoneNumber $phonenumber = null;
|
||||
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, length: 40, nullable: true)]
|
||||
|
Reference in New Issue
Block a user