Add phone number

This commit is contained in:
Charles 2025-07-16 15:03:41 +02:00
parent bbe50dbfd9
commit 8f232498b8
2 changed files with 50 additions and 7 deletions

View File

@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250710090534 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE "user" ADD phone_number VARCHAR(20) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE "user" DROP phone_number');
}
}

View File

@ -45,7 +45,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
private ?\DateTimeImmutable $createdAt = null;
#[ORM\Column(length: 255)]
private ?string $picture_url = null;
private ?string $pictureUrl = null;
#[ORM\Column(options: ['default' => 'CURRENT_TIMESTAMP'])]
private ?\DateTimeImmutable $modifiedAt = null;
@ -59,10 +59,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTime $lastConnection = null;
#[ORM\Column(length: 20, nullable: true)]
private ?string $phoneNumber = null;
public function __construct()
{
}
public function getId(): ?int
{
@ -177,12 +176,12 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
public function getPictureUrl(): ?string
{
return $this->picture_url;
return $this->pictureUrl;
}
public function setPictureUrl(string $picture_url): static
public function setPictureUrl(string $pictureUrl): static
{
$this->picture_url = $picture_url;
$this->pictureUrl = $pictureUrl;
return $this;
}
@ -243,5 +242,17 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
return $this;
}
public function getPhoneNumber(): ?string
{
return $this->phoneNumber;
}
public function setPhoneNumber(?string $phoneNumber): static
{
$this->phoneNumber = $phoneNumber;
return $this;
}
}