| Q | A
|------------ | ------
| BC Break | no
| Version orm | 2.6.2
| Version dbal | 2.8.0
| DB | Postgresql 9.6
It looks like this issue, but for sure it is not fixed in Orm 2.6.2:
https://github.com/doctrine/dbal/issues/3265
I have custom type:
class TextEncryptedType extends TextType {
public function getName() {
return TextEncryptedType::TEXT_ENCRYPTED;
}
public function requiresSQLCommentHint(AbstractPlatform $platform): bool {
return true;
}
}
When adding new field type="text_encrypted" to entity everything seems to be ok when executing doctrine:schema:update:
ALTER TABLE sometable ADD somecolumn TEXT DEFAULT NULL;
COMMENT ON COLUMN sometable.somecolumn IS '(DC2Type:text_encrypted)';
But if I have already existing field type="text" and I will change it to type="text_encrypted" result is:
ALTER TABLE sometable ALTER somecolumn TYPE TEXT;
ALTER TABLE sometable ALTER somecolumn DROP DEFAULT;
DC2Type comment is not added. So doctrine:chema:update --dump-sql will always schow above alter commands.
Same thing is when you try to do text_encrypted -> text (comment is not removed) or text_encrypted -> string_encrypted (comment is not updated - yes, I created another custom type to test that).
So it looks like comment hints are added when creating field, but never updated/removed even when they should.
May I ask why this is completely ignored?
@jifer seems valid, but nobody worked on it.
Most helpful comment
@jifer seems valid, but nobody worked on it.