When using the MakerBundle in Symfony (4) to create new entity (make:entity EntityName
), an id is generated by default with annotation (if annotations enabled) @GeneratedValue
.
@GeneratedValue
means @GeneratedValue(strategy="AUTO")
.
According to the Doctrine documentation, the AUTO
strategy is supposed to use SERIAL type for the id in PostgreSQL. But, I do not know why in my case, the AUTO
strategy use SEQUENCE for the id.
Then, I can force it to use SERIAL by changing by hand into @GeneratedValue(strategy="IDENTITY")
which means using SERIAL type in PostgreSQL.
Is there any way to change the default @GeneratedValue annotation created by the MakerBundle for the new entities to be created with the @GeneratedValue(strategy="IDENTITY")
annotation ?