[DBAL-423] Optimize non-native GUID type declaration #465

wants to merge 2 commits into


None yet
4 participants

deeky666 commented Dec 23, 2013

Currently non-native GUID type is mapped to VARCHAR(255) which is not effective as GUID always has a fixed length of 36 characters. Therefore it should be mapped to CHAR(36) instead.


thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:


We use Jira to track the state of pull requests and the versions they got
included in.


beberlei commented Dec 24, 2013

This is a BC break


deeky666 commented Dec 24, 2013

Can you explain why this is a bc break?
Am 24.12.2013 17:31 schrieb "Benjamin Eberlei" notifications@github.com:

This is a BC break

Reply to this email directly or view it on GitHubhttps://github.com/doctrine/dbal/pull/465#issuecomment-31177237


beberlei commented Dec 25, 2013

Because it requires database migrations for users that already use the GUID type to avoid having outstanding schema updates.


deeky666 commented Dec 25, 2013

Well, then each change to the comparator or platform alter table sql would
considerably be a bc break ;) i dont want to argue on this, just
understand. If it is a bc break then you can close it and mark the ticket
to be fixed in 3.0
Am 25.12.2013 12:33 schrieb "Benjamin Eberlei" notifications@github.com:

Because it requires database migrations for users that already use the
GUID type to avoid having outstanding schema updates.

Reply to this email directly or view it on GitHub.


beberlei commented Dec 25, 2013

We only fix issues on comparator and try to introduce new features so that the schema doesnt need updates. We cant fix this here, same as we cannot change the Object and ArrayTypes to encode their serialize input with base64 in the database to prevent problems with th enullbytes.


deeky666 commented Jan 9, 2014

@beberlei IMO this is NOT a BC break because it will not generate useless update statements when using the schema tool. The reason for this is that it does not change the Doctrine\DBAL\Schema\Column definition and therefore the comparator will not detect any changes. It will only have an effect if either a new guid type column is created, or an exisiting column is changed to a guid type column.


beberlei commented Feb 8, 2014

@deeky666 Not sure tbh, it still starts suggestion db changes, which sucks :(


deeky666 commented Feb 8, 2014

@beberlei Did you try that actually? I'm pretty sure that it does NOT affect existing schemas and will NOT generate changes with the schema tool for the reasons I explained earlier. Or am I getting you wrong here?


deeky666 commented Sep 2, 2014

@beberlei okay rebased this PR and fixed the comparator to NOT detect schema changes for GUID type columns. The added tests prove this, length and fixed options are ignored by the comparator now for GUID type columns so CHAR(36) vs. VARCHAR(255) will be the same for GUID now (preserves BC). Have another thought about this?

@Ocramius Ocramius self-assigned this Sep 10, 2014

@Ocramius Ocramius closed this in c8b58d9 Sep 10, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment