fix: allow null for teamer date of birth

This commit is contained in:
Björn Fromme
2024-10-28 17:44:00 +01:00
parent 3aad618eea
commit 1c59b1d564
2 changed files with 32 additions and 1 deletions
+31
View File
@@ -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)\'');
}
}
+1 -1
View File
@@ -43,7 +43,7 @@ class Teamer implements TimestampableEntityInterface
#[Assert\NotBlank(message: 'Bitte gib dein Geschlecht an', groups: ['profile'])]
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'])]
private ?\DateTimeImmutable $dateOfBirth = null;