DDC-2843: SchemaTool update SQL always contains queries to set default value on columns, even if they haven't changed. #3597

doctrinebot opened this Issue Dec 7, 2013 · 2 comments

2 participants


Jira issue originally created by user pamil:

For example, I've got this schema:

use Doctrine\ORM\Mapping as ORM;

 * @ORM\Table(name="tbl_company")
 * @ORM\Entity
class Company
     * @ORM\Column(name="verified", type="boolean", nullable=false, options={"default"=false})
    protected $verified = false;

I introduce column "verified", which is not nullable and this way I want all old entries to automatically update - it works. Then, I'm working and doing another updates. In every update SQL there is ALTER query, though default value haven't been changed since I had created it.
ALTER TABLE tbl_company ALTER verified SET DEFAULT 'false';

Shouldn't it check for changes and apply this query only if default value is changed? When I'm creating migrations, there are about ~60 queries which doesn't change anything and ex. 1 which does - it's very distracting.


Comment created by @beberlei:

This is an issue in DBAL. This should be reproduced using the \Doctrine\DBAL\Schema\Table API and then fixedn on DBAL.


Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot added this to the 2.4.2 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment