DDC-1324: Update schema fails to recognize correct schema #1658

Closed
opened 2026-01-22 13:21:26 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 9, 2011).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user adamk:

When the primary key is a text string the update:schema command fails to recognize that the database schema is correct, and with every call to update:schema it tries again and again to make the same, unneeded change.

class BillMethod
{
/****
* @ORM\Id
* @ORM\Column(type="string", length=50, nullable=false)
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
protected $sid;
...
}

When I run update:schema, I tells me this change is needed.

ALTER TABLE billmethod CHANGE sid sid VARCHAR(50) NOT NULL;

But, it's already there.

mysql> desc billmethod;
------------------------------------------------------
| Field | Type | Null | Key | Default | Extra |
------------------------------------------------------
| sid | varchar(50) | NO | PRI | NULL | |
...

The SQL does nothing, and update:schema tells me that this change still needs to be made.

Originally created by @doctrinebot on GitHub (Aug 9, 2011). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user adamk: When the primary key is a text string the update:schema command fails to recognize that the database schema is correct, and with every call to update:schema it tries again and again to make the same, unneeded change. class BillMethod { /**** \* @ORM\Id \* @ORM\Column(type="string", length=50, nullable=false) \* @ORM\GeneratedValue(strategy="IDENTITY") */ protected $sid; ... } When I run update:schema, I tells me this change is needed. ALTER TABLE billmethod CHANGE sid sid VARCHAR(50) NOT NULL; But, it's already there. mysql> desc billmethod; <ins>--------------</ins>-------------<ins>------</ins>-----<ins>---------</ins>-------<ins> | Field | Type | Null | Key | Default | Extra | </ins>--------------<ins>-------------</ins>------<ins>-----</ins>---------<ins>-------</ins> | sid | varchar(50) | NO | PRI | NULL | | ... The SQL does nothing, and update:schema tells me that this change still needs to be made.
admin added the Bug label 2026-01-22 13:21:26 +01:00
admin closed this issue 2026-01-22 13:21:28 +01:00
Author
Owner

@doctrinebot commented on GitHub (Jan 23, 2013):

Comment created by @ocramius:

Cannot reproduce on current version - was most probably fixed

@doctrinebot commented on GitHub (Jan 23, 2013): Comment created by @ocramius: Cannot reproduce on current version - was most probably fixed
Author
Owner

@doctrinebot commented on GitHub (Jan 23, 2013):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Jan 23, 2013): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1658