mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
orm:schema-tool:update always generates sql with no changes? #6672
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 @FLasH3r on GitHub (Apr 1, 2021).
New to Doctrine.
Using
"doctrine/orm": "^2.8"in mycomposer.jsoncreated a basic "Page" entity
when running
./vendor/bin/doctrine orm:schema-tool:create --dump-sqlI get:
Which is what I want, so I run it without
--dump-sql, the table is created and all is good.But, if I add any field, to any other entity (or even the same one)
Running this:
./vendor/bin/doctrine orm:schema-tool:update --dump-sqlAlways return this:
Even if I didn't touched it.
Am I missing something here?
This is how I set things up:
@beberlei commented on GitHub (Apr 1, 2021):
This is probably caused by the options={unsigned: true}, which is not very well supported in the Schema compare sadly.
@FLasH3r commented on GitHub (Apr 1, 2021):
But the update CLI call doesn't refer to it at all...
if I remove it like so:
I still get the
createdAtalter query when I run:./vendor/bin/doctrine orm:schema-tool:update --dump-sql@beberlei commented on GitHub (Apr 1, 2021):
Oh sorry, i didn't see the columnDefinition's. These will always cause the changes, there is no way around it. We can't compare this against the current state.
That is a downside of diff-based schema changes, because its very hard to make both different sides into a single datastructure.
That is why usually you would use something like Doctrine Migrations, Liquibase or DB Deploy for SQL migrations.
Sorry :-(