From 2ad6c533ec1f53ea7768785813d2852b4b3a494c Mon Sep 17 00:00:00 2001 From: Gregoire Date: Tue, 15 Jun 2021 19:02:33 +0200 Subject: [PATCH] feat(contributor): extend intro length --- Makefile | 6 ++++++ migrations/Version20210615164457.php | 30 ++++++++++++++++++++++++++++ src/Entity/Contributor.php | 4 ++-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 migrations/Version20210615164457.php diff --git a/Makefile b/Makefile index 61d752ce..d67a0146 100644 --- a/Makefile +++ b/Makefile @@ -46,3 +46,9 @@ down: jwt: $(SYMFONY) lexik:jwt:generate-keypair + +migrations-generate: + $(SYMFONY) doctrine:migrations:generate + +migrations-migrate: + $(SYMFONY) doctrine:migrations:migrate \ No newline at end of file diff --git a/migrations/Version20210615164457.php b/migrations/Version20210615164457.php new file mode 100644 index 00000000..b32fa8f2 --- /dev/null +++ b/migrations/Version20210615164457.php @@ -0,0 +1,30 @@ +abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE contributor CHANGE intro intro TEXT DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('ALTER TABLE contributor CHANGE intro intro VARCHAR(255) CHARACTER SET utf8 DEFAULT NULL COLLATE `utf8_unicode_ci`'); + } +} diff --git a/src/Entity/Contributor.php b/src/Entity/Contributor.php index c8c3df3d..acdd0516 100644 --- a/src/Entity/Contributor.php +++ b/src/Entity/Contributor.php @@ -74,8 +74,8 @@ class Contributor implements ImageUploadable /** * @var string * - * @ORM\Column(name="intro", type="string", length=255, nullable=true) - * @Assert\Length(max="255") + * @ORM\Column(name="intro", type="string", length=65535, nullable=true) + * @Assert\Length(max="65535") */ private $intro;