Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dmytroboiko opened this issue Nov 13, 2017 · 6 comments
Assignees
Labels

Comments

@dmytroboiko
Copy link

dmytroboiko commented Nov 13, 2017

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.

@coudenysj
Copy link
Contributor

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

@dmytroboiko
Copy link
Author

dmytroboiko commented 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

@lcobucci
Copy link
Member

@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

@dmytroboiko
Copy link
Author

@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

@lcobucci
Copy link
Member

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

@lcobucci
Copy link
Member

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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants