fix: allow null for teamer date of birth
This commit is contained in:
@@ -0,0 +1,31 @@
|
|||||||
|
<?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 Version20241028164059 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 teamer CHANGE date_of_birth date_of_birth DATE DEFAULT NULL COMMENT \'(DC2Type:date_immutable)\'');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('ALTER TABLE teamer CHANGE date_of_birth date_of_birth DATE NOT NULL COMMENT \'(DC2Type:date_immutable)\'');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,7 +43,7 @@ class Teamer implements TimestampableEntityInterface
|
|||||||
#[Assert\NotBlank(message: 'Bitte gib dein Geschlecht an', groups: ['profile'])]
|
#[Assert\NotBlank(message: 'Bitte gib dein Geschlecht an', groups: ['profile'])]
|
||||||
private ?string $gender = null;
|
private ?string $gender = null;
|
||||||
|
|
||||||
#[ORM\Column(type: Types::DATE_IMMUTABLE)]
|
#[ORM\Column(type: Types::DATE_IMMUTABLE, nullable: true)]
|
||||||
#[Assert\NotNull(message: 'Bitte gib dein Geburtsdatum an', groups: ['profile'])]
|
#[Assert\NotNull(message: 'Bitte gib dein Geburtsdatum an', groups: ['profile'])]
|
||||||
private ?\DateTimeImmutable $dateOfBirth = null;
|
private ?\DateTimeImmutable $dateOfBirth = null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user