diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 10620dc0f..c38dd97c6 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -42,7 +42,7 @@ class User implements AdvancedUserInterface protected ?int $id = null; /** - * @ORM\Column(type="datetime", nullable=true) + * @ORM\Column(type="datetime_immutable", nullable=true) */ private ?DateTimeImmutable $absenceStart = null; diff --git a/src/Bundle/ChillMainBundle/Form/AbsenceType.php b/src/Bundle/ChillMainBundle/Form/AbsenceType.php index 1f43093e5..8600fd019 100644 --- a/src/Bundle/ChillMainBundle/Form/AbsenceType.php +++ b/src/Bundle/ChillMainBundle/Form/AbsenceType.php @@ -24,6 +24,7 @@ class AbsenceType extends AbstractType $builder ->add('absenceStart', ChillDateTimeType::class, [ 'required' => true, + 'input' => 'datetime_immutable', ]); } diff --git a/src/Bundle/ChillMainBundle/migrations/Version20230111160610.php b/src/Bundle/ChillMainBundle/migrations/Version20230111160610.php index 1c5f74897..3bdffa6ea 100644 --- a/src/Bundle/ChillMainBundle/migrations/Version20230111160610.php +++ b/src/Bundle/ChillMainBundle/migrations/Version20230111160610.php @@ -22,6 +22,7 @@ final class Version20230111160610 extends AbstractMigration public function down(Schema $schema): void { $this->addSql('ALTER TABLE users DROP absenceStart'); + $this->addSql('COMMENT ON COLUMN users.absenceStart IS \'(DC2Type:datetime_immutable)\''); } public function getDescription(): string