Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/CoreBundle/Migrations/Schema/V200/Version20251007110500.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

/* For licensing terms, see /license.txt */

namespace Chamilo\CoreBundle\Migrations\Schema\V200;

use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;

final class Version20251007110500 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Make c_blog_task.description nullable and drop invalid default on TEXT/LONGTEXT.';
}

public function up(Schema $schema): void
{
$this->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');
}
}
4 changes: 2 additions & 2 deletions src/CourseBundle/Entity/CBlogTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';

Expand Down Expand Up @@ -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
Expand Down
Loading