You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can confirm this is an issue. Changing a field's type from integer to money (custom type that extends integer, and returns true for requiresSQLCommentHint) should have created a comment on doctrine:schema:update --dump-sql, but it doesn't:
current output:
ALTER TABLE foobar ALTER fruit TYPE INT
ALTER TABLE foobar ALTER fruit DROP DEFAULT
expected output:
ALTER TABLE foobar ALTER fruit TYPE INT
ALTER TABLE foobar ALTER fruit DROP DEFAULT
COMMENT ON COLUMN foobar.fruit IS '(DC2Type:money)'
Oh and we are using postgresql, but I'm pretty sure it affects other drivers too. Hope this helps!
Hi, I have similar issue. I add CITEXT type mapping (on PostgreSQL), and in each migration I have:
//migration
$this->addSql('ALTER TABLE managers ALTER email TYPE CITEXT');
$this->addSql('ALTER TABLE managers ALTER email DROP DEFAULT');
$this->addSql('ALTER TABLE managers ALTER email TYPE CITEXT');
//CitextType
public function requiresSQLCommentHint(AbstractPlatform $platform)
{
return $platform->getName() !== 'postgresql'; // I also tries to return true - no effect
}
Even if previously successfully migration contain the same queries.
Jira issue originally created by user vbence:
I have found a previous issue, http://www.doctrine-project.org/jira/browse/[DBAL-1085](http://www.doctrine-project.org/jira/browse/DBAL-1085) which tells about the need to override "requiresSQLCommentHint" if the custom type uses an SQL type which is already known by Doctrine.
See also:
dbal/lib/Doctrine/DBAL/Types/Type.php
Lines 327 to 340 in bfee907
The bug: After I learned this and added the required TRUE return value, the migration (generated by "diff") won't contain the comment.
After adding the comment manually, everything works as expected.
The text was updated successfully, but these errors were encountered: