From 4f6fc9ed01feb39c1e2e89a01e857b0d3fe3fb0f Mon Sep 17 00:00:00 2001 From: tchapi Date: Tue, 28 Sep 2021 15:38:46 +0200 Subject: [PATCH] Add default value for calendarorder column following #35 --- migrations/Version20210928132307.php | 29 ++++++++++++++++++++++++++++ src/Entity/CalendarInstance.php | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 migrations/Version20210928132307.php diff --git a/migrations/Version20210928132307.php b/migrations/Version20210928132307.php new file mode 100644 index 0000000..f9dc29d --- /dev/null +++ b/migrations/Version20210928132307.php @@ -0,0 +1,29 @@ +addSql('ALTER TABLE calendarinstances CHANGE calendarorder calendarorder INT DEFAULT 0 NOT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE calendarinstances CHANGE calendarorder calendarorder INT NOT NULL'); + } +} diff --git a/src/Entity/CalendarInstance.php b/src/Entity/CalendarInstance.php index 8b16933..cc7c488 100644 --- a/src/Entity/CalendarInstance.php +++ b/src/Entity/CalendarInstance.php @@ -66,7 +66,7 @@ class CalendarInstance private $description; /** - * @ORM\Column(name="calendarorder", type="integer") + * @ORM\Column(name="calendarorder", type="integer", options={"default" : 0}) */ private $calendarOrder;