The command doctrine:schema:update doesn't see what field already MEDIUMTEXT #5769

Closed
opened 2026-01-22 15:17:18 +01:00 by admin · 6 comments
Owner

Originally created by @dmytroboiko on GitHub (Nov 13, 2017).

Originally assigned to: @dmytroboiko on GitHub.

I have a field which I want to be mysql mediumtext
Example.orm.yaml

AppBundle\Entity\Example:
    type: entity
    table: example
    id:
        id:
            type: bigint
            id: true
            generator:
                strategy: AUTO
            options:
                unsigned: true
    fields:
        description:
            column: description
            type: string
            length: 1.5E6

Everything is fine, field created as 'mediumtext'
but whenever I run
php bin/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 @dmytroboiko on GitHub (Nov 13, 2017). Originally assigned to: @dmytroboiko on GitHub. I have a field which I want to be mysql mediumtext Example.orm.yaml ``` AppBundle\Entity\Example: type: entity table: example id: id: type: bigint id: true generator: strategy: AUTO options: unsigned: true fields: description: column: description type: string length: 1.5E6 ``` Everything is fine, field created as 'mediumtext' but whenever I run php bin/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 Question label 2026-01-22 15:17:18 +01:00
admin closed this issue 2026-01-22 15:17:18 +01:00
Author
Owner

@coudenysj commented on GitHub (Nov 17, 2017):

Could you paste the "CREATE TABLE" sql (from without your database)?

@coudenysj commented on GitHub (Nov 17, 2017): Could you paste the "CREATE TABLE" sql (from without your database)?
Author
Owner

@dmytroboiko commented on GitHub (Nov 17, 2017):

@coudenysj

CREATE TABLE example (
    id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
    description MEDIUMTEXT NOT NULL,
    PRIMARY KEY (id)
)  DEFAULT CHARACTER SET UTF8 COLLATE UTF8_UNICODE_CI ENGINE=INNODB
@dmytroboiko commented on GitHub (Nov 17, 2017): @coudenysj ``` CREATE TABLE example ( id BIGINT UNSIGNED AUTO_INCREMENT NOT NULL, description MEDIUMTEXT NOT NULL, PRIMARY KEY (id) ) DEFAULT CHARACTER SET UTF8 COLLATE UTF8_UNICODE_CI ENGINE=INNODB ```
Author
Owner

@lcobucci commented on GitHub (Nov 27, 2017):

@dmytroboiko have you tried to use the type that the documentation recommends (text)? http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#character-string-types

@lcobucci commented on GitHub (Nov 27, 2017): @dmytroboiko have you tried to use the type that the documentation recommends (text)? http://docs.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/types.html#character-string-types
Author
Owner

@dmytroboiko commented on GitHub (Nov 27, 2017):

@lcobucci, Yes I tried. But if I setted type: text and length: 1.5E6. Command php bin/console doctrine:schema:update --dump-sql create field description with type TEXT independently of the length settings

@dmytroboiko commented on GitHub (Nov 27, 2017): @lcobucci, Yes I tried. But if I setted type: `text` and length: `1.5E6`. Command `php bin/console doctrine:schema:update --dump-sql` create field `description` with type TEXT independently of the length settings
Author
Owner

@lcobucci commented on GitHub (Nov 27, 2017):

@dmytroboiko this sounds like a DBAL issue then, can you please send us a PR over there with a failing test case?

@lcobucci commented on GitHub (Nov 27, 2017): @dmytroboiko this sounds like a DBAL issue then, can you please send us a PR over there with a failing test case?
Author
Owner

@lcobucci commented on GitHub (Nov 27, 2017):

I'll also close this issue since it doesn't seem to be related to the ORM, don't forget to add a link to it on the DBAL PR.

@lcobucci commented on GitHub (Nov 27, 2017): I'll also close this issue since it doesn't seem to be related to the ORM, don't forget to add a link to it on the DBAL PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5769