在 128 次尝试中无法为 "value" 生成随机唯一值

Couldn't generate random unique value for "value" in 128 tries

我正在定义这个夹具:

Clanmovil\PlatformBundle\Entity\Alias:
    alias_{1..500}:
        name (unique): Alias_<numberBetween(1, 500)>
        description: <text(150)>
        active: <boolean(31)>
        createdAt: <dateTimeThisYear()>
        updatedAt: <dateTimeThisYear()>

我在控制台收到此错误:

[RuntimeException] Couldn't generate random unique value for Clanmovil\PlatformBundle\Entity\Alias: name in 128 tries.

我通过 bundle 源上的这个错误做了一些研究,但我不清楚问题可能是什么。这里有什么问题?遇到这样的问题怎么办?

如果这有帮助,这就是实体的样子:

namespace Clanmovil\PlatformBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Clanmovil\PlatformBundle\Model\IdentifierAutogeneratedTrait;
use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Timestampable\Traits\TimestampableEntity;

/**
 * @ORM\Entity
 * @ORM\Table(name="cm_alias",
 *      uniqueConstraints={@ORM\UniqueConstraint(name="name", columns={"name"})},
        indexes={@ORM\Index(name="fulltext_idx",
            columns={"name"},
            flags={"fulltext"})})
 * )
 */
class Alias
{
    use IdentifierAutogeneratedTrait;
    use TimestampableEntity;

    /**
     * @var string
     * @ORM\Column(type="string", length=150)
     * @Assert\NotBlank()
     */
    protected $name;

    /**
     * @var string
     * @ORM\Column(type="text", nullable=true)
     */
    protected $description;

    /**
     * @var bool
     * @ORM\Column(type="boolean")
     */
    protected $active = true;

    /**
     * @ORM\ManyToMany(targetEntity="Command", mappedBy="command_alias", cascade={"persist"})
     */
    protected $alias_command;


    /**
     * Set name.
     *
     * @param string $name
     * @return Alias
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

    /**
     * Get name.
     *
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Set description.
     *
     * @param string $description
     *
     * @return Alias
     */
    public function setDescription($description)
    {
        $this->description = $description;

        return $this;
    }

    /**
     * Get description.
     *
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Set active.
     *
     * @param bool $active
     *
     * @return Category
     */
    public function setActive($active)
    {
        $this->active = $active;

        return $this;
    }

    /**
     * Get active.
     *
     * @return bool
     */
    public function getActive()
    {
        return $this->active;
    }

    /**
     * Get command for alias
     *
     * @return string
     */
    public function getAliasCommand()
    {
        return $this->alias_command;
    }

    public function __toString()
    {
        return $this->name;
    }

}

我不知道这是否是最佳解决方案,但到目前为止,我通过增加随机数的数量解决了这个问题:

name (unique): Alias_<numberBetween(1, 1000)>