DDC-1045: Schema-tool update missbehavior: Not changed columns generating empty SET #1305

Closed
opened 2026-01-22 13:09:09 +01:00 by admin · 10 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 25, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user lucasts:

HI,

It seems that some ghost changes are showing up.
In the dcm.yml definition I had that snippet:

  lanceProposta:
    type: boolean
    column: lance_proposta

and in another dcm

  tipo:
    type: integer

just to be clear, those columns are already in the database, as you can see in this dump:
first snippet:

            Column          |              Type         |    Modifiers                 
----------------<ins>---------------------------</ins>--------------
 tipo           | integer                   | not null

second snippet:

            Column                   |              Type         |    Modifiers                 
-------------------------<ins>---------------------------</ins>--------------
 lance_proposta          | boolean                   | not null default false

And, running: /doctrine orm:schema-tool:update --dump-sql I got that:

ALTER TABLE lance ALTER lance_proposta SET ;
ALTER TABLE pessoa_juridica ALTER tipo SET ;

As you can see, both columns had empty SET, that will become a exception in pgsql

I'm not sure why, can be because project has made(and still is) during alpha and beta doctrine 2

Anyways, thanks for the doctrine 2, help us a lot.

Originally created by @doctrinebot on GitHub (Feb 25, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user lucasts: HI, It seems that some ghost changes are showing up. In the dcm.yml definition I had that snippet: ``` lanceProposta: type: boolean column: lance_proposta ``` and in another dcm ``` tipo: type: integer ``` just to be clear, those columns are already in the database, as you can see in this dump: first snippet: ``` sql Column | Type | Modifiers ----------------<ins>---------------------------</ins>-------------- tipo | integer | not null ``` second snippet: ``` Column | Type | Modifiers -------------------------<ins>---------------------------</ins>-------------- lance_proposta | boolean | not null default false ``` And, running: **/doctrine orm:schema-tool:update --dump-sql** I got that: ``` sql ALTER TABLE lance ALTER lance_proposta SET ; ALTER TABLE pessoa_juridica ALTER tipo SET ; ``` As you can see, both columns had empty SET, that will become a exception in pgsql I'm not sure why, can be because project has made(and still is) during alpha and beta doctrine 2 Anyways, thanks for the doctrine 2, help us a lot.
admin added the Bug label 2026-01-22 13:09:09 +01:00
admin closed this issue 2026-01-22 13:09:09 +01:00
Author
Owner
@doctrinebot commented on GitHub (Feb 25, 2011): - relates to [DBAL-44: nullable is not working for all datatypes](http://www.doctrine-project.org/jira/browse/DBAL-44) - relates to [DBAL-720: [GH-456] [DBAL-44] Fix column default value lifecycle](http://www.doctrine-project.org/jira/browse/DBAL-720)
Author
Owner

@doctrinebot commented on GitHub (Feb 25, 2011):

Comment created by @beberlei:

You are saying you use Doctrine Master or Alpha/Beta? I don't understand from your comments.

@doctrinebot commented on GitHub (Feb 25, 2011): Comment created by @beberlei: You are saying you use Doctrine Master or Alpha/Beta? I don't understand from your comments.
Author
Owner

@doctrinebot commented on GitHub (Feb 26, 2011):

Comment created by lucasts:

Sorry for that.
I wish to say that we developed the project following most of the doctrine 2 phases(before alpha, all alphas, beta and finally the release)
So I was thinking that some garbage was generated during previous versions of doctrine. But this I'm supposing.

But to make it clear, all snippets and tests related above are from doctrine git master branch.

I'll try to do some investigating this weekend, I'm pretty sure that is something related to dc2 pgsql driver.

@doctrinebot commented on GitHub (Feb 26, 2011): Comment created by lucasts: Sorry for that. I wish to say that we developed the project following most of the doctrine 2 phases(before alpha, all alphas, beta and finally the release) So I was thinking that some garbage was generated during previous versions of doctrine. But this I'm supposing. But to make it clear, all snippets and tests related above are from doctrine git master branch. I'll try to do some investigating this weekend, I'm pretty sure that is something related to dc2 pgsql driver.
Author
Owner

@doctrinebot commented on GitHub (May 1, 2011):

Comment created by @beberlei:

You can only really debug this by hacking into the code, can you open up lib/Doctrine/DBAL/Schema/Comparator.php and var_dump the value returned in diffColumn ?

@doctrinebot commented on GitHub (May 1, 2011): Comment created by @beberlei: You can only really debug this by hacking into the code, can you open up lib/Doctrine/DBAL/Schema/Comparator.php and var_dump the value returned in diffColumn ?
Author
Owner

@doctrinebot commented on GitHub (Mar 15, 2012):

Comment created by @asm89:

Closing because we were unable to reproduce and no further feedback was provided.

@doctrinebot commented on GitHub (Mar 15, 2012): Comment created by @asm89: Closing because we were unable to reproduce and no further feedback was provided.
Author
Owner

@doctrinebot commented on GitHub (Mar 15, 2012):

Issue was closed with resolution "Cannot Reproduce"

@doctrinebot commented on GitHub (Mar 15, 2012): Issue was closed with resolution "Cannot Reproduce"
Author
Owner

@doctrinebot commented on GitHub (May 15, 2014):

Comment created by finwe:

Could you please reopen? I'd be glad to help with debugging.

From what I've dumped, these are parameters and output of diffColumns which result in alter SQL

ALTER TABLE company ALTER evidencenumberseq SET ;

Doctrine\DBAL\Schema\Column {
   _type protected Doctrine\DBAL\Types\IntegerType 
   _length protected NULL
   _precision protected 10
   _scale protected 0
   _unsigned protected FALSE
   _fixed protected FALSE
   _notnull protected TRUE
   _default protected "0"
   _autoincrement protected FALSE
   _platformOptions protected array 
   _columnDefinition protected NULL
   _comment protected ""
   _customSchemaOptions protected array 
   _name protected "evidencenumberseq"
   _namespace protected NULL
   _quoted protected FALSE
}

Doctrine\DBAL\Schema\Column {
   _type protected Doctrine\DBAL\Types\IntegerType 
   _length protected NULL
   _precision protected 0
   _scale protected 0
   _unsigned protected FALSE
   _fixed protected FALSE
   _notnull protected TRUE
   _default protected NULL
   _autoincrement protected FALSE
   _platformOptions protected array {
      version FALSE
   }
   _columnDefinition protected NULL
   _comment protected NULL
   _customSchemaOptions protected array 
   _name protected "evidenceNumberSeq"
   _namespace protected NULL
   _quoted protected FALSE
}

array [
   0 "default"
]

Is this helpful? Should I dump anything else?

@doctrinebot commented on GitHub (May 15, 2014): Comment created by finwe: Could you please reopen? I'd be glad to help with debugging. From what I've dumped, these are parameters and output of diffColumns which result in alter SQL `ALTER TABLE company ALTER evidencenumberseq SET ;` ``` Doctrine\DBAL\Schema\Column { _type protected Doctrine\DBAL\Types\IntegerType _length protected NULL _precision protected 10 _scale protected 0 _unsigned protected FALSE _fixed protected FALSE _notnull protected TRUE _default protected "0" _autoincrement protected FALSE _platformOptions protected array _columnDefinition protected NULL _comment protected "" _customSchemaOptions protected array _name protected "evidencenumberseq" _namespace protected NULL _quoted protected FALSE } Doctrine\DBAL\Schema\Column { _type protected Doctrine\DBAL\Types\IntegerType _length protected NULL _precision protected 0 _scale protected 0 _unsigned protected FALSE _fixed protected FALSE _notnull protected TRUE _default protected NULL _autoincrement protected FALSE _platformOptions protected array { version FALSE } _columnDefinition protected NULL _comment protected NULL _customSchemaOptions protected array _name protected "evidenceNumberSeq" _namespace protected NULL _quoted protected FALSE } array [ 0 "default" ] ``` Is this helpful? Should I dump anything else?
Author
Owner

@doctrinebot commented on GitHub (May 15, 2014):

Comment created by @ocramius:

[~finwe] please abstract it into a test case, then we can re-open the issue.

@doctrinebot commented on GitHub (May 15, 2014): Comment created by @ocramius: [~finwe] please abstract it into a test case, then we can re-open the issue.
Author
Owner

@doctrinebot commented on GitHub (May 15, 2014):

Comment created by finwe:

Ran that on 2.4.0 before, it got fixed in 2.4.2, can stay closed.

@doctrinebot commented on GitHub (May 15, 2014): Comment created by finwe: Ran that on 2.4.0 before, it got fixed in 2.4.2, can stay closed.
Author
Owner

@doctrinebot commented on GitHub (May 16, 2014):

Comment created by @deeky666:

It was fixed in commit: 8fe7410538

@doctrinebot commented on GitHub (May 16, 2014): Comment created by @deeky666: It was fixed in commit: https://github.com/doctrine/dbal/commit/8fe741053849afadef12b8bef1cc3203966ef78f
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1305