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

Missing default length on ID field type string #11382

Open
bigfoot90 opened this issue Mar 19, 2024 · 0 comments
Open

Missing default length on ID field type string #11382

bigfoot90 opened this issue Mar 19, 2024 · 0 comments

Comments

@bigfoot90
Copy link

BC Break Report

Q A
BC Break yes
Version 3.1.0

Summary

Migrating from 2.19.2 to 3.1.0 I'm getting an error running schema:diff
Error:

In InvalidColumnDeclaration.php line 17:
  Column "site_name" has invalid type  
                                       
In ColumnLengthRequired.php line 26:
  Doctrine\DBAL\Platforms\MariaDB1060Platform requires the length of a VARCHAR column to be specified  

Previous behavior

Mapping before migration:

    <entity name="Domain\Model\Entity\Site">
        <id name="name" type="string"/>
        <field name="token" unique="true"/>
    </entity>

Current behavior

Actual mapping:

    <entity name="Domain\Model\Entity\Site">
        <id name="name" type="string" length="255"/>
        <field name="token" unique="true"/>
    </entity>

Expected behavior

Be able to migrate schema without errors and don't see changes on column name length.

How to reproduce

Create an entity with Id type string.
Value 255 was the default length for type string in ORM 2.19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant