DDC-1737: MEDIUMTEXT field #2185

Closed
opened 2026-01-22 13:43:38 +01:00 by admin · 4 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 29, 2012).

Originally assigned to: @guilhermeblanco on GitHub.

Jira issue originally created by user olegk:

I have a field which I want to be mysql mediumtext
/****
* @var string $description
*
* @ORM\Column(name="description", type="string", length=65536)
*/
private $description;

Everything is fine, field created as 'mediumtext'
but whenever I run
php app/console doctrine:schema:update --dump-sql

I get
ALTER TABLE table CHANGE description description MEDIUMTEXT NOT NULL;
though description is MEDIUMTEXT already.

Originally created by @doctrinebot on GitHub (Mar 29, 2012). Originally assigned to: @guilhermeblanco on GitHub. Jira issue originally created by user olegk: I have a field which I want to be mysql mediumtext /**** \* @var string $description \* \* @ORM\Column(name="description", type="string", length=65536) */ private $description; Everything is fine, field created as 'mediumtext' but whenever I run php app/console doctrine:schema:update --dump-sql I get ALTER TABLE table CHANGE description description MEDIUMTEXT NOT NULL; though description is MEDIUMTEXT already.
admin added the Bug label 2026-01-22 13:43:38 +01:00
admin closed this issue 2026-01-22 13:43:39 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 23, 2012):

Comment created by @guilhermeblanco:

Issue seems to be fixed already in master.

Coverage test:
4030787aa1

@doctrinebot commented on GitHub (May 23, 2012): Comment created by @guilhermeblanco: Issue seems to be fixed already in master. Coverage test: https://github.com/doctrine/dbal/commit/4030787aa178b5c85d4717a75c43eb122edbd68d
Author
Owner

@doctrinebot commented on GitHub (May 23, 2012):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (May 23, 2012): Issue was closed with resolution "Fixed"
Author
Owner

@fmonts commented on GitHub (Feb 16, 2020):

I still have the exact same issue with orm 2.7.1, dbal 2.10.1

/**
 * @ORM\Column(type="string", length=16777215, nullable=false)
 * @Assert\Length(max=16777215)
 * @Assert\NotBlank()
 */
private $content;

show create table:

`content` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,

php bin/console doctrine:schema:update --dump-sql:

ALTER TABLE messages CHANGE content content MEDIUMTEXT NOT NULL;

The same if I change length to 65536 or I remove nullable=false.

@fmonts commented on GitHub (Feb 16, 2020): I still have the exact same issue with orm 2.7.1, dbal 2.10.1 /** * @ORM\Column(type="string", length=16777215, nullable=false) * @Assert\Length(max=16777215) * @Assert\NotBlank() */ private $content; show create table: `content` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL, php bin/console doctrine:schema:update --dump-sql: ALTER TABLE messages CHANGE content content MEDIUMTEXT NOT NULL; The same if I change length to 65536 or I remove `nullable=false`.
Author
Owner

@petski commented on GitHub (Feb 28, 2020):

For anyone running into the same issue as @fmonts:

Use type="text" instead of type="string", i.e.:

@ORM\Column(type="text", length=16777215, nullable=false)

@petski commented on GitHub (Feb 28, 2020): For anyone running into the same issue as @fmonts: Use `type="text"` instead of `type="string"`, i.e.: `@ORM\Column(type="text", length=16777215, nullable=false)`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2185