Merge pull request #5333 from christianbeeznest/settings-current

Internal: Expand title and comment to TEXT in settings_current - refs #5313
pull/5337/head
christianbeeznest 8 months ago committed by GitHub
commit 514fb78d2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      src/CoreBundle/Entity/SettingsCurrent.php
  2. 34
      src/CoreBundle/Migrations/Schema/V200/Version20240404164500.php

@ -44,10 +44,10 @@ class SettingsCurrent
protected ?string $selectedValue = null;
#[Assert\NotBlank]
#[ORM\Column(name: 'title', type: 'string', length: 255, nullable: false)]
#[ORM\Column(name: 'title', type: 'text', nullable: false)]
protected string $title;
#[ORM\Column(name: 'comment', type: 'string', length: 255, nullable: true)]
#[ORM\Column(name: 'comment', type: 'text', nullable: true)]
protected ?string $comment = null;
#[ORM\Column(name: 'scope', type: 'string', length: 50, nullable: true)]

@ -0,0 +1,34 @@
<?php
/* For licensing terms, see /license.txt */
declare(strict_types=1);
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
use Doctrine\DBAL\Schema\Schema;
final class Version20240404164500 extends AbstractMigrationChamilo
{
public function getDescription(): string
{
return 'Alter "title" and "comment" fields in settings_current table';
}
public function up(Schema $schema): void
{
if ($schema->hasTable('settings_current')) {
$this->addSql('ALTER TABLE settings_current MODIFY COLUMN title TEXT NOT NULL');
$this->addSql('ALTER TABLE settings_current MODIFY COLUMN comment TEXT');
}
}
public function down(Schema $schema): void
{
if ($schema->hasTable('settings_current')) {
$this->addSql('ALTER TABLE settings_current MODIFY COLUMN title VARCHAR(255) NOT NULL');
$this->addSql('ALTER TABLE settings_current MODIFY COLUMN comment VARCHAR(255)');
}
}
}
Loading…
Cancel
Save