Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-423

Type GUID = VARCHAR(255) on platforms that don't have a native GUID support

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5
    • Component/s: None
    • Labels:
      None

      Description

      I'm using MySQL with entities that have GUID ids. Therefore I'm using @ORM\Column(type="guid") for the ORM mapping. As MySQL does not have a native GUID data type, it gets mapped to type="string" with a default length of 255 -> VARCHAR(255). I don't really understand why we don't limit the length to 36, which is the fixed length for GUIDs. You could even think about using CHAR(36) for MySQL.

      -> see Doctrine\DBAL\Platforms\AbstractPlatform -> getGuidTypeDeclarationSQL()

        Issue Links

          Activity

            People

            • Assignee:
              Steve Müller
              Reporter:
              amr
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: