Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-105

Schema Comparator produces invalid SQL

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.4
    • Component/s: Schema Managers
    • Labels:
      None
    • Environment:
      Windows7, PHP 5.3.3

      Description

      Before:

      /**
       * @orm:Entity
       * @orm:Table(name="twitter_users")
       */
      class TwitterUser implements UserInterface
      {
          const ROLE_DEFAULT = 'ROLE_TWITTER_USER';
      
          /**
           * @orm:Id
           * @orm:GeneratedValue(strategy="AUTO")
           * @orm:Column(type="integer")
           */
          private $id;
      
          /**
           * @orm:Column(type="integer", unique=true, nullable=false)
           */
          private $twitterId;
      
          /**
           * @orm:Column(type="string", unique=true, nullable=false)
           */
          private $displayName;
      }
      

      After:

      /**
       * @orm:Entity
       * @orm:Table(name="twitter_users")
       */
      class TwitterUser implements UserInterface
      {
          const ROLE_DEFAULT = 'ROLE_TWITTER_USER';
      
          /**
           * @orm:Id
           * @orm:GeneratedValue(strategy="AUTO")
           * @orm:Column(type="integer")
           */
          private $id;
      
          /**
           * @orm:Column(type="integer", unique=true, nullable=false, name="twitter_id")
           */
          private $twitterId;
      
          /**
           * @orm:Column(type="string", unique=true, nullable=false, name="display_name")
           */
          private $displayName;
      
          /**
           * @orm:Column(type="datetime", name="last_logged_in_at", nullable=true)
           */
          private $lastLoggedInAt;
      }
      

      Bugs in the generated SQL:

      • last_logged_in_at column is not added
      • displayName is dropped, and at the same time the column name "displayName" is changed to "display_name"
      • twitterId same as above

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed

        Show
        Benjamin Eberlei added a comment - Fixed

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Johannes Schmitt
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: