-
-
Notifications
You must be signed in to change notification settings - Fork 453
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
Configuration for collation in default table options (collate/collation) #1468
Comments
After doctrine/dbal#5246 is released, this bundle should be modified to use either UPD: it just got released |
@greg0ire @aprat84 I actually still have this issue on dbal 3.3.2 I'm using
I also tried
and
no luck. Always get those weird
Is there a workaround? |
@dmaicher by updating dbal to 3.3.2 and changing the option from Here's my current dbal config: doctrine:
dbal:
url: '%env(resolve:DATABASE_URL)%'
server_version: '8.0'
driver: 'pdo_mysql'
charset: utf8mb4
default_table_options:
charset: utf8mb4
collation: utf8mb4_unicode_ci |
Ah it actually seems I'm using a mix of collations for different tables (some have |
Hi, We have the same issue on a project. We have a mix of We tried all different combinations and we still face to the issue in 3.3.2. We rolled-back to 3.3.0 and it is working. We spotted But the fix for 3.3.2 is not working for us Any ideas? |
With 3.3.2 there are no more weird migrations! But, be aware: ConnectionFactory will configure both connection charset (utf8mb4) and, on MySQL/MariaDB, With the recent changes in DBAL 3.3.2, So, for me, doctrine:
dbal:
charset: utf8mb4
default_table_options:
charset: utf8mb4
collation: utf8mb4_0900_ai_ci
engine: InnoDB Maybe a quick fix would be to check for both names: if (!isset($params['defaultTableOptions']['collate']) && !isset($params['defaultTableOptions']['collation'])) {
$params['defaultTableOptions']['collate'] = 'utf8mb4_unicode_ci';
} And in the future, with DBAL v4, get rid of it. |
Hi @aprat84, Thanks for your quick reply. We put both and we still have the issue Thanks |
As mentioned earlier, I believe somebody should send a PR to the DoctrineBundle. Everything that has been done for The logic should be: check for both options, give precedence to DoctrineBundle/ConnectionFactory.php Line 83 in 6e578fd
|
Will report a new bug As for me bugs is located in: \Doctrine\DBAL\Platforms\AbstractPlatform::getColumnDeclarationSQL
when fetching column information from database this two fields are populated in my case
but when doctrine builds schema from entity this two fields are empty. and later when \Doctrine\DBAL\Platforms\AbstractPlatform::getColumnDeclarationSQL is called, two strings do not match, |
In some places in this bundle and DBAL
collate
is used, in some other placescollation
is used. doctrine/dbal#5214I need to put both in my config:
If I only use
collate
(it worked before updating DBAL from 3.2.1 to 3.3.1), schema comparator, which usescollation
config, detects changes and generates weird migrations when executingdoctrine:migrations:diff
command: emptyup()
and adown()
full of useless ALTER TABLE.If I only use
collation
, it creates new tables withutf8mb4_unicode_ci
collation.I know DBAL v4 won't force any charset/collation, but still the config documentation feels wrong...
https://github.com/doctrine/DoctrineBundle/blob/2.5.x/Resources/doc/configuration.rst
The text was updated successfully, but these errors were encountered: