Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

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.

@doctrinebot

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.

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.4.2 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.