I am using mapper for doctrine2 to create my innoDB database (mysql). How to set the initial value of my auto_incremented id using php annotations?
This is how I modeled the identifier of my entity type at the moment.
/** * @var integer $_id * * @Column(name="id", type="integer", nullable=false) * @Id * @GeneratedValue(strategy="IDENTITY") */ private $_id;
I found the following code in the documentation, but it looks like it will use a separate table to create identifiers.
/** * @Id * @GeneratedValue(strategy="SEQUENCE") * @Column(type="integer") * @SequenceGenerator(sequenceName="tablename_seq", initialValue=1, allocationSize=100) */
source share