mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Change accompanyingCourse Resources comment by a string
This commit is contained in:
parent
72a15bb823
commit
af2eca0d03
@ -44,9 +44,10 @@ class Resource
|
|||||||
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
private ?AccompanyingPeriod $accompanyingPeriod = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\ManyToOne(targetEntity=Comment::class)
|
* @ORM\Column(type="text", nullable=true)
|
||||||
|
* @Groups({"read", "write"})
|
||||||
*/
|
*/
|
||||||
private $comment;
|
private string $comment = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Id
|
* @ORM\Id
|
||||||
@ -75,7 +76,7 @@ class Resource
|
|||||||
return $this->accompanyingPeriod;
|
return $this->accompanyingPeriod;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getComment(): ?Comment
|
public function getComment(): ?string
|
||||||
{
|
{
|
||||||
return $this->comment;
|
return $this->comment;
|
||||||
}
|
}
|
||||||
@ -111,9 +112,9 @@ class Resource
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setComment(?Comment $comment): self
|
public function setComment(?string $comment = null): self
|
||||||
{
|
{
|
||||||
$this->comment = $comment;
|
$this->comment = (string) $comment;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Chill\Migrations\Person;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20220104133334 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return 'Replace accompanyingCourse Resources comment by a string';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_person_accompanying_period_resource DROP CONSTRAINT fk_dc78989ff8697d13');
|
||||||
|
$this->addSql('DROP INDEX idx_dc78989ff8697d13');
|
||||||
|
$this->addSql('ALTER TABLE chill_person_accompanying_period_resource ADD comment TEXT DEFAULT NULL');
|
||||||
|
$this->addSql('ALTER TABLE chill_person_accompanying_period_resource DROP comment_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
$this->addSql('ALTER TABLE chill_person_accompanying_period_resource ADD comment_id INT DEFAULT NULL');
|
||||||
|
$this->addSql('ALTER TABLE chill_person_accompanying_period_resource DROP comment');
|
||||||
|
$this->addSql('ALTER TABLE chill_person_accompanying_period_resource ADD CONSTRAINT fk_dc78989ff8697d13 FOREIGN KEY (comment_id) REFERENCES chill_person_accompanying_period_comment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||||
|
$this->addSql('CREATE INDEX idx_dc78989ff8697d13 ON chill_person_accompanying_period_resource (comment_id)');
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user