Skip to content
Snippets Groups Projects
Verified Commit ed6a940e authored by Jonas Leder's avatar Jonas Leder
Browse files

add name field to user

parent 2c6fd219
Branches
No related tags found
No related merge requests found
<?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 Version20221125085936 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 users ADD name VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE users DROP name');
}
}
...@@ -29,6 +29,9 @@ class Users implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -29,6 +29,9 @@ class Users implements UserInterface, PasswordAuthenticatedUserInterface
#[ORM\ManyToMany(targetEntity: WebResetter::class, inversedBy: 'users')] #[ORM\ManyToMany(targetEntity: WebResetter::class, inversedBy: 'users')]
private Collection $webResetter; private Collection $webResetter;
#[ORM\Column(length: 255, nullable: true)]
private ?string $name = null;
public function __construct() public function __construct()
{ {
$this->webResetter = new ArrayCollection(); $this->webResetter = new ArrayCollection();
...@@ -116,4 +119,16 @@ class Users implements UserInterface, PasswordAuthenticatedUserInterface ...@@ -116,4 +119,16 @@ class Users implements UserInterface, PasswordAuthenticatedUserInterface
return $this; return $this;
} }
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment