Answer the question
In order to leave comments, you need to log in
Simfony + doctrine creating a table. Why is a varchar field created for a field with the specified integer type?
/**
* @ORM\Entity{repositoryClass="UrlsRepository"}
* @ORM\Table{name="app_urlshortener_urls"}
* @ORM\HasLifecycleCallbacks
*/
class Urls{
/**
* @ORM\Id()
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\GeneratedValue{strategy="AUTO"}
*
* @var int
*
*/
protected $id;
/**
* @ORM\Column(type="text", nullable=true)
*/
protected $url;
...
Answer the question
In order to leave comments, you need to log in
Mdya...
In the general field became int(11) when generally removed and left:
@ORM\Id
@ORM\Column(type="integer")
@ORM\GeneratedValue
Moreover. I used to have $em->persist crash with an error. And now it's working.
A sorcerer himself, and how I hate all this shamanism!
You can close the question.
No witchcraft. You have the table name:
@ORM\Table{name="app_urlshortener_urls"}
and the urls table is described elsewhere
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question