mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1324: Update schema fails to recognize correct schema #1658
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
@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):
Issue was closed with resolution "Invalid"