mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Problem to update DiscriminatorColumn name #5259
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 @Gowsan10 on GitHub (Sep 15, 2016).
Hello,
I have a problem on update DiscriminatorColumn name
Entities:
Before I didn't add the annotation: @ORM\DiscriminatorColumn(name="item_type", type="string") on "Item", So by default I had the column dType. I wanted to rename the fields by " item_type " so I added the annotation And I execute the following command:
The modifcation on the database was executed successfully but When I call the function getListCars(), I have the following error:
An exception occurred while executing 'SELECT t3.id AS id_4, t3.created_at AS created_at_5, t3.updated_at AS updated_at_6, t2.id AS id_7, t1.id AS id_8, t0.id AS id_9, t3.dtype FROM car t0 INNER JOIN vehicle t1 ON t0.id = t1.id INNER JOIN product t2 ON t0.id = t2.id INNER JOIN item t3 ON t0.id = t3.id':
SQLSTATE[42S22]: Column not found: 1054 Unknown column 't3.dtype' in 'field list'
So I thought it was the cache and I executed the following commands:
But I have the same error.
Anyone have the solution ?
@chishiuanlu commented on GitHub (Apr 19, 2018):
I am having very similar issue with this.
After updating the column name in the code and the db, now the column can't be found error pops up with the persist call.
Has this been answered or resolved in any place?
I have tried using clear cache and schema-tool to update the schema. validate-schema returns OK for everything but the error still not going away.
Any help would be appreciated.