[DDC-3613] [GH-1330] Fix @Column options sections in documentation Created: 12/Mar/15  Updated: 12/Mar/15  Resolved: 12/Mar/15

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Documentation, Mapping Drivers
Affects Version/s: None
Fix Version/s: 2.5
Security Level: All

Type: Documentation Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Fixed Votes: 0
Labels: annotation, collate, column, documentation, metadata, schema, schema-tool


 Description   

This issue is created automatically through a Github pull request on behalf of coolmic:

Url: https://github.com/doctrine/doctrine2/pull/1330

Message:

I lose hours to find out how to make column collation works, mostly because of incorrect docs.

Annotations options is the equivalent of customSchemaOptions in https://github.com/doctrine/dbal/blob/master/docs/en/reference/schema-representation.rst

See https://github.com/doctrine/doctrine2/blob/d1e5034659e7beeb11830417a4a38de6586fe960/lib/Doctrine/ORM/Tools/SchemaTool.php#L443



 Comments   
Comment by Doctrine Bot [ 12/Mar/15 ]

A related Github Pull-Request [GH-1330] was assigned:
https://github.com/doctrine/doctrine2/pull/1330

Comment by Doctrine Bot [ 12/Mar/15 ]

A related Github Pull-Request [GH-1330] was merged:
https://github.com/doctrine/doctrine2/pull/1330





[DDC-2139] Table collate/charset doesn't inherits from database Created: 12/Nov/12  Updated: 25/Nov/12  Resolved: 25/Nov/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM, Tools
Affects Version/s: 2.3
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: William Knak Assignee: Benjamin Eberlei
Resolution: Won't Fix Votes: 0
Labels: charset, collate, collation, mysql, utf, utf8
Environment:

Symfony2



 Description   

Using symfony2 command doctrine:schema:create the tables and Varchar fields are Collate/Charset are not inherited from database. I changed MySQL defaults to latin1/latin1_general_ci; The doctrine:database:create works; but tables and fields don't. So I found there is a code on MySqlPlataform.php:

if ( ! isset($options['charset']))

{ $options['charset'] = 'utf8'; }

if ( ! isset($options['collate']))

{ $options['collate'] = 'utf8_unicode_ci'; }

$query .= 'DEFAULT CHARACTER SET ' . $options['charset'];
$query .= ' COLLATE ' . $options['collate'];

So if you don't pass collate and charset as entity options, it will put utf8 and utf8_unicode_ci instead of dabatase default charset.

My suggestion is to change a little bit to:

if (isset($options['charset']))

{ $query .= 'DEFAULT CHARACTER SET ' . $options['charset']; }

if (isset($options['collate']))

{ $query .= ' COLLATE ' . $options['collate']; }

 Comments   
Comment by Benjamin Eberlei [ 25/Nov/12 ]

If we change it, then it will be like before and users disliked that very much. The decision is to use UTF-8 as default and everybody else has to change the information instead of the other way around.





[DDC-1274] there is no way to set collate of the table charset ! Created: 13/Jul/11  Updated: 12/Nov/12  Resolved: 13/Jul/11

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: 2.0.6
Fix Version/s: None
Security Level: All

Type: Bug Priority: Critical
Reporter: sina miandashti Assignee: Benjamin Eberlei
Resolution: Invalid Votes: 0
Labels: charset, collate, collation, mysql
Environment:

zend frame work 1.10 with doctrine orm 2 and dbal



 Description   

i searched a lot for this

there is no way to set the collate of table fields to for ex. utf8_persian_ci in doctrine settings



 Comments   
Comment by Benjamin Eberlei [ 13/Jul/11 ]

This is not a supported feature, if you set the collation in the CREATE DATABASE statement this will inherit to all fields automatically.

Comment by William Knak [ 12/Nov/12 ]

Actually Doctrine 2.3.0 does not allow inheritance. Please look at Issue #DDC-2139 . At least, if there's an option to set a global default collation (wich I didn't find), the problem will occurs every time a table of string/varchar field was created by Symfony2 Doctrine Command.





Generated at Fri May 29 22:49:41 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.