Joined columns not created with matching custom schema options #5768

Open
opened 2026-01-22 15:17:18 +01:00 by admin · 6 comments
Owner

Originally created by @NathanBaulch on GitHub (Nov 13, 2017).

Originally assigned to: @NathanBaulch on GitHub.

I have a many-to-one join between two string fields with the MySQL collation set to ASCII. Unfortunately the join column generated by SchemaTool doesn't inherit this collation because the incorrect metadata key options is passed instead of customSchemaOptions.

Changing line 673 of SchemaTool.php to:

$columnOptions['customSchemaOptions'] = $fieldMapping['options'];

fixes the issue and the migration diff tool no longer tries to convert my ASCII fields to the default UTF-8 collation.

Originally created by @NathanBaulch on GitHub (Nov 13, 2017). Originally assigned to: @NathanBaulch on GitHub. I have a `many-to-one` join between two string fields with the MySQL collation set to `ASCII`. Unfortunately the join column generated by `SchemaTool` doesn't inherit this collation because the incorrect metadata key `options` is passed instead of `customSchemaOptions`. Changing [line 673 of SchemaTool.php](https://github.com/doctrine/doctrine2/blob/a82f6c5725cb31348eae0b4414e8992b1400ba30/lib/Doctrine/ORM/Tools/SchemaTool.php#L673) to: ```php $columnOptions['customSchemaOptions'] = $fieldMapping['options']; ``` fixes the issue and the migration diff tool no longer tries to convert my ASCII fields to the default UTF-8 collation.
admin added the BugMissing Tests labels 2026-01-22 15:17:18 +01:00
Author
Owner

@lcobucci commented on GitHub (Nov 27, 2017):

@NathanBaulch could you please send us a failing test case that reproduces that behaviour (maybe even the fix)? It would help us a lot to identify and fix the issue you're describing.

You can find examples on 388afb46d0/tests/Doctrine/Tests/ORM/Functional/Ticket

@lcobucci commented on GitHub (Nov 27, 2017): @NathanBaulch could you please send us a failing test case that reproduces that behaviour (maybe even the fix)? It would help us a lot to identify and fix the issue you're describing. You can find examples on https://github.com/doctrine/doctrine2/tree/388afb46d0cb3ed0c51332e8df0de9e942c2690b/tests/Doctrine/Tests/ORM/Functional/Ticket
Author
Owner

@tok-88 commented on GitHub (Mar 1, 2018):

Anything new on this issue? @lcobucci

@tok-88 commented on GitHub (Mar 1, 2018): Anything new on this issue? @lcobucci
Author
Owner

@Ocramius commented on GitHub (Mar 1, 2018):

@tok-amsiq seen 657a54da84?

@Ocramius commented on GitHub (Mar 1, 2018): @tok-amsiq seen https://github.com/doctrine/doctrine2/commit/657a54da84765858e7e825c97faf54cfe8ff0039?
Author
Owner

@tok-88 commented on GitHub (Mar 1, 2018):

@Ocramius briefly yes :)
But since it hadn't been reviewed, I was just curious about the progress. I have the same issue and used the columnDefinition as a solution, but if this worked it would of course be preferred.

@tok-88 commented on GitHub (Mar 1, 2018): @Ocramius briefly yes :) But since it hadn't been reviewed, I was just curious about the progress. I have the same issue and used the columnDefinition as a solution, but if this worked it would of course be preferred.
Author
Owner

@Ocramius commented on GitHub (Mar 1, 2018):

@tok-amsiq if you have problems with this specific issue, please do provide a reproducible test case as suggested in https://github.com/doctrine/doctrine2/issues/6823#issuecomment-347095121

@Ocramius commented on GitHub (Mar 1, 2018): @tok-amsiq if you have problems with this specific issue, please do provide a reproducible test case as suggested in https://github.com/doctrine/doctrine2/issues/6823#issuecomment-347095121
Author
Owner

@tok-88 commented on GitHub (Mar 1, 2018):

@Ocramius I figured @NathanBaulch already had with 657a54d, but I'll look more into it when I have the time!

@tok-88 commented on GitHub (Mar 1, 2018): @Ocramius I figured @NathanBaulch already had with [657a54d](https://github.com/doctrine/doctrine2/commit/657a54da84765858e7e825c97faf54cfe8ff0039), but I'll look more into it when I have the time!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5768