Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type names with backslashes cause infinite upgrades #6752

Closed
greg0ire opened this issue Oct 4, 2017 · 3 comments
Closed

Type names with backslashes cause infinite upgrades #6752

greg0ire opened this issue Oct 4, 2017 · 3 comments

Comments

@greg0ire
Copy link
Member

greg0ire commented Oct 4, 2017

I'm planning ahead and starting to use FQCNs as custom doctrine type getName implementation, as well as registering them under that name with Type::addType. Sadly, it seems SQL comments with backslashes are somehow not matched with the desired value, and the upgrade command tries to change the type again and again with such queries:

ALTER TABLE transactions ALTER territory TYPE VARCHAR(255);
ALTER TABLE transactions ALTER territory DROP DEFAULT;
ALTER TABLE transactions ALTER price_value TYPE JSON;
ALTER TABLE transactions ALTER price_value DROP DEFAULT;
ALTER TABLE basic_metadata ALTER country_of_origin TYPE VARCHAR(255);
ALTER TABLE basic_metadata ALTER country_of_origin DROP DEFAULT;

The SQL comment is present, with double backslashes:

    Column  |     Type     | Modifiers | Storage | Stats target |                    Description                    
------------+------------------------+-----------+----------+--------------+-------------------------------------------------------------------------------------------
    alid    | character varying(255) | not null | extended |       | (DC2Type:TitlePublisher\\Infrastructure\\Persistence\\Doctrine\\Type\\AssetLogicalIdType)
 content_id | character varying(255) |      | extended |       | (DC2Type:EMA\\MD\\Doctrine\\Type\\SimpleType\\ContentIdType)
 avail_type | character varying(255) | not null | extended |       | (DC2Type:TitlePublisher\\Infrastructure\\Persistence\\Doctrine\\Type\\AvailTypeType)
@lcobucci
Copy link
Member

lcobucci commented Nov 26, 2017

@greg0ire this seems to be related to doctrine/dbal#2850, apart from the JSON stuff which is probably related to doctrine/dbal#2855.

But regardless of anything it's a DBAL issue, can you please close it here and create a new issue there (if it's still happening on the latest DBAL release, sure).

@greg0ire
Copy link
Member Author

I'll try to remember to test tomorrow at work :P

@greg0ire
Copy link
Member Author

Ok so I still have an issue, but it is different. See doctrine/dbal#2926

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants