DDC-625: orm:schema-tool:update --dump-sql showing SQL when DB is up-to-date #769

Open
opened 2026-01-22 12:49:50 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 3, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user darkangel:

With the following entities ...
\


/****
 * @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)```
Originally created by @doctrinebot on GitHub (Jun 3, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user darkangel: 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)``` ``````
admin added the Bug label 2026-01-22 12:49:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#769