Problem custom name sequeceGenerator YAML for annotatition entities #5103

Closed
opened 2026-01-22 14:58:22 +01:00 by admin · 1 comment
Owner

Originally created by @monstrodopantano on GitHub (Apr 18, 2016).

Originally assigned to: @ostrolucky on GitHub.

Problem custom name sequeceGenerator YAML why not create the custom name you want. Being created the default postgres, where is the problem?

Message:
  type: entity
  id:
    id:
      type: integer
      generator:
        strategy: SEQUENCE
      sequenceGenerator:
        **sequenceName: message_sq**
        allocationSize: 100
        initialValue: 1

The entity is created like this:
use Doctrine\ORM\Mapping as ORM;

/**
 * Message
 *
 * @ORM\Table(name="message")
 * @ORM\Entity
 * @ORM\HasLifecycleCallbacks
 */
class Message
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="SEQUENCE")
     * @ORM\SequenceGenerator(**sequenceName="message_id_seq"**, allocationSize=1, initialValue=1)
     */

Should be created as specify:

/**
 * Message
 *
 * @ORM\Table(name="message")
 * @ORM\Entity
 * @ORM\HasLifecycleCallbacks
 */
class Message
{
    /**
     * @var integer
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="SEQUENCE")
     * @ORM\SequenceGenerator(**sequenceName="message_sq",** allocationSize=1, initialValue=1)
     */
Originally created by @monstrodopantano on GitHub (Apr 18, 2016). Originally assigned to: @ostrolucky on GitHub. Problem custom name sequeceGenerator YAML why not create the custom name you want. Being created the default postgres, where is the problem? ``` yml Message: type: entity id: id: type: integer generator: strategy: SEQUENCE sequenceGenerator: **sequenceName: message_sq** allocationSize: 100 initialValue: 1 ``` The entity is created like this: use Doctrine\ORM\Mapping as ORM; ``` php /** * Message * * @ORM\Table(name="message") * @ORM\Entity * @ORM\HasLifecycleCallbacks */ class Message { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="SEQUENCE") * @ORM\SequenceGenerator(**sequenceName="message_id_seq"**, allocationSize=1, initialValue=1) */ ``` Should be created as specify: ``` php /** * Message * * @ORM\Table(name="message") * @ORM\Entity * @ORM\HasLifecycleCallbacks */ class Message { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="SEQUENCE") * @ORM\SequenceGenerator(**sequenceName="message_sq",** allocationSize=1, initialValue=1) */ ```
admin closed this issue 2026-01-22 14:58:22 +01:00
Author
Owner

@ostrolucky commented on GitHub (Aug 6, 2018):

Yaml driver has been removed in Doctrine 3.0 (see https://github.com/doctrine/doctrine2/pull/5932), so this is no longer relevant, sorry.

@ostrolucky commented on GitHub (Aug 6, 2018): Yaml driver has been removed in Doctrine 3.0 (see https://github.com/doctrine/doctrine2/pull/5932), so this is no longer relevant, sorry.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5103