diff --git a/migrations/Version20241028164059.php b/migrations/Version20241028164059.php new file mode 100644 index 0000000..e1a7d0d --- /dev/null +++ b/migrations/Version20241028164059.php @@ -0,0 +1,31 @@ +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)\''); + } +} diff --git a/src/Entity/Teamer.php b/src/Entity/Teamer.php index 65569a3..ab33739 100644 --- a/src/Entity/Teamer.php +++ b/src/Entity/Teamer.php @@ -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;