diff --git a/Resources/config/doctrine/Event.orm.yml b/Resources/config/doctrine/Event.orm.yml index eb02041e4..3d7e0ec5a 100644 --- a/Resources/config/doctrine/Event.orm.yml +++ b/Resources/config/doctrine/Event.orm.yml @@ -12,7 +12,7 @@ Chill\EventBundle\Entity\Event: type: string length: '150' date: - type: date + type: datetime oneToMany: participations: targetEntity: Chill\EventBundle\Entity\Participation diff --git a/Resources/migrations/Version20190110140538.php b/Resources/migrations/Version20190110140538.php new file mode 100644 index 000000000..545f58f58 --- /dev/null +++ b/Resources/migrations/Version20190110140538.php @@ -0,0 +1,29 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE chill_event_event ALTER date TYPE TIMESTAMP(0) WITHOUT TIME ZONE'); + $this->addSql('ALTER TABLE chill_event_event ALTER date DROP DEFAULT'); + + } + + public function down(Schema $schema) : void + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.'); + + $this->addSql('ALTER TABLE chill_event_event ALTER date TYPE DATE'); + $this->addSql('ALTER TABLE chill_event_event ALTER date DROP DEFAULT'); + } +}