Skip to content

Commit

Permalink
performance improvements: added db indexes + more strict field types
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristof Jochmans committed Apr 17, 2014
1 parent 3af9334 commit 892c0f1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Entity/Translation.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

namespace Kunstmaan\TranslatorBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
Expand All @@ -7,12 +8,12 @@
/**
* @ORM\Entity(repositoryClass="Kunstmaan\TranslatorBundle\Repository\TranslationRepository")
* @ORM\Table(
* name="kuma_translation",
* uniqueConstraints={
* @ORM\UniqueConstraint(name="keyword_per_locale", columns={"keyword", "locale", "domain"}),
* @ORM\UniqueConstraint(name="translation_id_per_locale", columns={"translation_id", "locale"}),
* },
* indexes={@ORM\Index(name="domain_idx",columns={"domain"}),@ORM\Index(name="locale_idx",columns={"locale"})}
* name="kuma_translation",
* uniqueConstraints={
* @ORM\UniqueConstraint(name="keyword_per_locale", columns={"keyword", "locale", "domain"}),
* @ORM\UniqueConstraint(name="translation_id_per_locale", columns={"translation_id", "locale"}),
* },
* indexes={@ORM\Index(name="idx_locale_domain", columns={"locale", "domain"})}
* )
* @ORM\HasLifecycleCallbacks
*/
Expand Down Expand Up @@ -45,15 +46,15 @@ class Translation
/**
* The translations keyword to use in your template or call from the translator
*
* @ORM\Column(type="string")
* @ORM\Column(type="string", length=5)
* @Assert\NotBlank()
*/
protected $locale;

/**
* Location where the translation comes from
*
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", length=50, nullable=true)
*/
protected $file;

Expand All @@ -67,7 +68,7 @@ class Translation
protected $text;

/**
* @ORM\Column(type="string")
* @ORM\Column(type="string", length=30)
* @Assert\NotBlank()
*/
protected $domain;
Expand All @@ -87,12 +88,11 @@ class Translation
protected $updatedAt;

/**
*
* A flag which defines the status of a specific translations ('updated', 'new', ..)
*
* @var string
*
* @ORM\Column(type="string", nullable=true)
* @ORM\Column(type="string", length=20, nullable=true)
*/
protected $flag = null;

Expand Down

0 comments on commit 892c0f1

Please sign in to comment.