Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-483

default values make orm:validate-schema fail

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.4
    • Component/s: None
    • Security Level: All
    • Labels:
    • Environment:
      MySQL, PHP 5.3, Doctrine 2.3

      Description

      % ./bin/doctrine.php --env=development orm:schema-tool:update --dump-sql                                                                                                  
      ALTER TABLE groups CHANGE active active TINYINT(1) DEFAULT '1' NOT NULL;
      ALTER TABLE module ADD root_order INT DEFAULT 0 NOT NULL
      % ./bin/doctrine.php --env=development orm:schema-tool:update --force
      Updating database schema...
      Database schema updated successfully! "2" queries were executed
      % ./bin/doctrine.php --env=development orm:schema-tool:update --dump-sql                                                                                                  ALTER TABLE groups CHANGE active active TINYINT(1) DEFAULT '1' NOT NULL;
      ALTER TABLE module CHANGE root_order root_order INT DEFAULT 0 NOT NULL
      

      My entities define these columns like this:

      Group
          /**
           * @ORM\Column(name="active", type="boolean", options={"default":true})
           */
          private $active = true;
      
      Module
          /**
           * @ORM\Column(name="root_order", type="integer", options={"default":0})
           */
          private $rootOrder = 0;
      

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Till
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: