-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow MySQL tables to be created using the database default character set and collation #4404
Comments
Seems related to old issue #1529 |
Not unrelated to #2441, either |
If giving a different meaning to NULL is considered a BC, we might introduce a string value of eg. 'default' with the meaning of 'use the db default'. Btw, the same logic can also be applied to the ENGINE specification. |
This looks like the right concern to me. The DBAL shouldn't enforce such defaults. Please feel free to initiate a PR.
I believe it would be a BC break because right now these options are checked via
What if we introduce temporary boolean options instead, e.g. |
This will be fixed in 4.0.0 by #4644. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Feature Request
Summary
The current implementation of
MySqlPlatform::buildTableOptions
makes it unnecessarily hard to create "generic" php code that would be useful for creating tables that do not specify the character set and/or collation in their creation SQL statement.As mysql allows to specify charset and collation defaults for a database, it seems a useful solution for many scenarios to allow to specify the charset/collection once, as db defaults, and then omit them from all/most table definitions.
Example usecase: bundle A creates tables, using a different charset/collation in its versions 1 and 2; bundle B creates tables that need to be joined to the tables of A, and tries to be compatible with both A.1 and A.2.
At the moment the developer is forced to specify the charset if she wants not to have 'utf8', and for older version of Doctrine this leads in cascade to having to specify collation as well (otherwise DBAL might attempt to set an invalid collation).
The default character set / collation of the database seem almost impossible to be retrieved and taken into account.
What about accepting NULL as valid options for 'charset' and 'collate', which would result in the table-creation SQL statement omitting the DEFAULT CHARACTER SET and COLLATE clauses?
The text was updated successfully, but these errors were encountered: