mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
remove timezone from calendar and calendar range
This commit is contained in:
parent
dab9204ec7
commit
dc22d18e6a
@ -102,7 +102,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
private CommentEmbeddable $comment;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetimetz_immutable")
|
||||
* @ORM\Column(type="datetime_immutable", nullable=false)
|
||||
* @Serializer\Groups({"calendar:read", "read"})
|
||||
*/
|
||||
private ?DateTimeImmutable $endDate = null;
|
||||
@ -169,7 +169,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
private ?bool $sendSMS;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetimetz_immutable")
|
||||
* @ORM\Column(type="datetime_immutable", nullable=false)
|
||||
* @Serializer\Groups({"calendar:read", "read"})
|
||||
*/
|
||||
private ?DateTimeImmutable $startDate = null;
|
||||
@ -550,6 +550,7 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface
|
||||
|
||||
public function setStartDate(DateTimeImmutable $startDate): self
|
||||
{
|
||||
dump('startDate', $startDate);
|
||||
$this->startDate = $startDate;
|
||||
|
||||
return $this;
|
||||
|
@ -38,7 +38,7 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface
|
||||
private ?Calendar $calendar = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetimetz_immutable")
|
||||
* @ORM\Column(type="datetime_immutable", nullable=false)
|
||||
* @groups({"read", "write", "calendar:read"})
|
||||
*/
|
||||
private ?DateTimeImmutable $endDate = null;
|
||||
@ -52,7 +52,7 @@ class CalendarRange implements TrackCreationInterface, TrackUpdateInterface
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetimetz_immutable")
|
||||
* @ORM\Column(type="datetime_immutable", nullable=false)
|
||||
* @groups({"read", "write", "calendar:read"})
|
||||
*/
|
||||
private ?DateTimeImmutable $startDate = null;
|
||||
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\Calendar;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20220606153851 extends AbstractMigration
|
||||
{
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER endDate TYPE TIMESTAMP(0) WITH TIME ZONE');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER endDate DROP DEFAULT');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER startDate TYPE TIMESTAMP(0) WITH TIME ZONE');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER startDate DROP DEFAULT');
|
||||
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar.enddate IS \'(DC2Type:datetimetz_immutable)\'');
|
||||
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar.startdate IS \'(DC2Type:datetimetz_immutable)\'');
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'remove timezone from dates in calendar entity';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER startdate TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER startdate DROP DEFAULT');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER enddate TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar ALTER enddate DROP DEFAULT');
|
||||
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar.startDate IS \'(DC2Type:datetime_immutable)\'');
|
||||
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar.endDate IS \'(DC2Type:datetime_immutable)\'');
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\Calendar;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20220606154119 extends AbstractMigration
|
||||
{
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER endDate TYPE TIMESTAMP(0) WITH TIME ZONE');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER endDate DROP DEFAULT');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startDate TYPE TIMESTAMP(0) WITH TIME ZONE');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startDate DROP DEFAULT');
|
||||
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.enddate IS \'(DC2Type:datetimetz_immutable)\'');
|
||||
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.startdate IS \'(DC2Type:datetimetz_immutable)\'');
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'remove timezone from calendar range';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startdate TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER startdate DROP DEFAULT');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER enddate TYPE TIMESTAMP(0) WITHOUT TIME ZONE');
|
||||
$this->addSql('ALTER TABLE chill_calendar.calendar_range ALTER enddate DROP DEFAULT');
|
||||
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.startDate IS \'(DC2Type:datetime_immutable)\'');
|
||||
$this->addSql('COMMENT ON COLUMN chill_calendar.calendar_range.endDate IS \'(DC2Type:datetime_immutable)\'');
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user