diff --git a/src/CoreBundle/Migrations/Schema/V200/Version20251007110500.php b/src/CoreBundle/Migrations/Schema/V200/Version20251007110500.php new file mode 100644 index 00000000000..808a600425b --- /dev/null +++ b/src/CoreBundle/Migrations/Schema/V200/Version20251007110500.php @@ -0,0 +1,29 @@ +addSql('ALTER TABLE c_blog_task MODIFY description LONGTEXT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('UPDATE c_blog_task SET description = "" WHERE description IS NULL'); + $this->addSql('ALTER TABLE c_blog_task MODIFY description LONGTEXT NOT NULL'); + } +} diff --git a/src/CourseBundle/Entity/CBlogTask.php b/src/CourseBundle/Entity/CBlogTask.php index 97e91068ef4..4de2a454629 100644 --- a/src/CourseBundle/Entity/CBlogTask.php +++ b/src/CourseBundle/Entity/CBlogTask.php @@ -49,7 +49,7 @@ class CBlogTask #[Groups(['blog_task:read', 'blog_task:write', 'task_rel_user:read'])] protected string $title; - #[ORM\Column(name: 'description', type: 'text', nullable: false, options: ['default' => ''])] + #[ORM\Column(name: 'description', type: 'text', nullable: true)] #[Groups(['blog_task:read', 'blog_task:write'])] protected string $description = ''; @@ -102,7 +102,7 @@ public function setTitle(string $title): self public function getDescription(): string { - return $this->description; + return $this->description ?? ''; } public function setDescription(string $description): self