Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-647

string length not taken into account on id while using Yaml driver

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA1
    • Fix Version/s: 2.0-BETA3
    • Component/s: Mapping Drivers
    • Security Level: All
    • Labels:
      None

      Description

      The string lenght specified in the Yaml file is not respected on id columns.

      Sample YAML file

      ---
      # Entities.Stock.dcm.yml
      Entities\Stock:
        type: entity
        table: stocks
        id:
          id:
            type: string
            length: 10
            generator:
              strategy: NONE
        fields:
          nature:
            type: string
            length: 10
          name:
            type: string
            length: 40
          creationDate:
            name: creation_date
            type: datetime
          owner:
            type: string
            length: 8
      

      Command used to generate the SQL statements:
      ./doctrine orm:schema-tool:create --dump-sql

      Result:

      CREATE TABLE stocks (id VARCHAR(255) NOT NULL, nature VARCHAR(12) NOT
      NULL, name VARCHAR(40) NOT NULL, creationDate DATETIME NOT NULL, owner
      VARCHAR(8) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB
      

      The "id" is generated as VARCHAR(255) instead of VARCHAR(10).

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed formating

        Show
        Benjamin Eberlei added a comment - Fixed formating
        Show
        Christian Heinrich added a comment - Fixed: http://github.com/Shurakai/doctrine2/tree/DDC-647
        Hide
        Benjamin Eberlei added a comment - - edited

        Hey Christian, please don't mark bugs as fixed that have not been merged into the main repository yet.

        Merged now

        Show
        Benjamin Eberlei added a comment - - edited Hey Christian, please don't mark bugs as fixed that have not been merged into the main repository yet. Merged now

          People

          • Assignee:
            Christian Heinrich
            Reporter:
            Guillaume ORIOL
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: