如何使用注释设置自动递增 id 的起始值?
我希望它从 250000 开始
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
protected $id;
最佳答案
/**
* @ORM\Id
* @ORM\GeneratedValue(strategy="SEQUENCE")
* @ORM\SequenceGenerator(sequenceName="id", initialValue=250000)
* @ORM\Column(type="integer")
*/
protected $id;
http://doctrine-orm.readthedocs.org/en/latest/reference/basic-mapping.html
关于php - Doctrine 自动递增起始值 @ORM\GeneratedValue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31867992/