change date to datetime for evaluation document

This commit is contained in:
Julie Lenaerts 2022-04-27 17:13:38 +02:00
parent f14c915502
commit 09aa7ff631
2 changed files with 43 additions and 2 deletions

View File

@ -40,7 +40,7 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
private ?AccompanyingPeriodWorkEvaluation $accompanyingPeriodWorkEvaluation = null;
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
* @ORM\Column(type="datetime_immutable", nullable=true, options={"default": null})
* @Serializer\Groups({"read"})
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
*/
@ -111,7 +111,7 @@ class AccompanyingPeriodWorkEvaluationDocument implements \Chill\MainBundle\Doct
private ?string $title = '';
/**
* @ORM\Column(type="date_immutable", nullable=true, options={"default": null})
* @ORM\Column(type="datetime_immutable", nullable=true, options={"default": null})
* @Serializer\Groups({"read"})
* @Serializer\Groups({"accompanying_period_work_evaluation:create"})
*/

View File

@ -0,0 +1,41 @@
<?php
declare(strict_types=1);
namespace Chill\Migrations\Person;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220427150431 extends AbstractMigration
{
public function getDescription(): string
{
return 'change date to datetime for evaluation documents';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ALTER createdat TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ALTER createdat DROP DEFAULT');
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ALTER updatedat TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ALTER updatedat DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation_document.createdAt IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation_document.updatedAt IS \'(DC2Type:datetime_immutable)\'');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ALTER createdAt TYPE DATE');
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ALTER createdAt DROP DEFAULT');
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ALTER updatedAt TYPE DATE');
$this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation_document ALTER updatedAt DROP DEFAULT');
$this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation_document.createdat IS \'(DC2Type:date_immutable)\'');
$this->addSql('COMMENT ON COLUMN chill_person_accompanying_period_work_evaluation_document.updatedat IS \'(DC2Type:date_immutable)\'');
}
}