[DDC-1324] Update schema fails to recognize correct schema Created: 09/Aug/11  Updated: 23/Jan/13  Resolved: 23/Jan/13

Status: Closed
Project: Doctrine 2 - ORM
Component/s: None
Affects Version/s: 2.0
Fix Version/s: None
Security Level: All

Type: Bug Priority: Minor
Reporter: Adam Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None
Environment:

OSX 10.6.8
PHP 5.3.4
Mysql 5.1.43



 Description   

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.



 Comments   
Comment by Marco Pivetta [ 23/Jan/13 ]

Cannot reproduce on current version - was most probably fixed

Generated at Tue Jul 29 23:08:36 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.