Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-BETA1
-
Fix Version/s: 2.0-BETA3
-
Component/s: None
-
Security Level: All
-
Labels:None
Description
With the following entities ...
<?php /** * @Entity * @Table(name="users") */ class App_Model_User { /** * @Id * @GeneratedValue(strategy="IDENTITY") * @Column(type="integer") */ private $id; /** * @ManyToOne(targetEntity="App_Model_Role") * @JoinColumn(name="role_id", nullable=false) */ private $role; /** @Column(type="string", columnDefinition="CHAR(64) NOT NULL") */ private $password; } <?php /** * @Entity * @Table(name="roles") */ class App_Model_Role { /** * @Id * @GeneratedValue(strategy="IDENTITY") * @Column(type="smallint") */ private $id; }
I'm getting this output from orm:schema-tool:update --dump-sql, when the database is already up-to-date:
ALTER TABLE users CHANGE password password CHAR(64) NOT NULL; ALTER TABLE users DROP FOREIGN KEY users_ibfk_1; ALTER TABLE users ADD FOREIGN KEY (role_id) REFERENCES roles(id)
This is most probably equivalent with the following problem:
See /DBAL/Schema/Comparator.php ll. 172ff. & 293
Comparing whether both Types return the same SQL-Statement might do the job but would be really ugly.