Skip to content
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

[Hotfix] Limit length of indexed column to 191, for MySQL 5.6 compatibility #342

Merged
merged 1 commit into from Mar 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 16 additions & 10 deletions src/Entity/Translation.php
Expand Up @@ -4,29 +4,35 @@

namespace Gedmo\Translatable\Entity;

use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Index;
use Doctrine\ORM\Mapping\Table;
use Doctrine\ORM\Mapping\UniqueConstraint;
use Doctrine\ORM\Mapping as ORM;

/**
* Gedmo\Translatable\Entity\Translation
*
* @Table(
* @ORM\Table(
* name="translation",
* options={"row_format":"DYNAMIC"},
* indexes={@Index(name="translations_lookup_idx", columns={
* indexes={@ORM\Index(name="translations_lookup_idx", columns={
* "locale", "object_class", "foreign_key"
* })},
* uniqueConstraints={@UniqueConstraint(name="lookup_unique_idx", columns={
* uniqueConstraints={@ORM\UniqueConstraint(name="lookup_unique_idx", columns={
* "locale", "object_class", "field", "foreign_key"
* })}
* )
* @Entity(repositoryClass="Gedmo\Translatable\Entity\Repository\TranslationRepository")
* @ORM\Entity(repositoryClass="Gedmo\Translatable\Entity\Repository\TranslationRepository")
*/
class Translation extends MappedSuperclass\AbstractTranslation
{
/*
* All required columns are mapped through inherited superclass
/**
* All required columns are mapped through inherited superclass, except
* for $objectClass, because we need to limit the length to 191, for MySQL 5.6
* compatibility. See https://github.com/doctrine/orm/issues/7416
*/

/**
* @var string
*
* @ORM\Column(name="object_class", type="string", length=191)
*/
protected $objectClass;
}