mam tabele GRIDS i rekord z grids ma przypisany jeszcze typ grida, czyli jest pole grid_type_id wskazujace na inny rekord z tabeli GRID_TYPES.
W Encji Grid mam opis kolumny gridType
/** * @var integer * * @ORM\ManyToOne(targetEntity="GIMO\GridBundle\Entity\GridType", inversedBy="grids") */ private $gridType;
Ale taki opis tworzy mi pole grid_type_id, ktore moze byc NULL. A ja wolalbym jednak by bylo NOT NULL. Idzie to jakos tu ustawic? probowalem z
* @ORM\Column(nullable=false)
ale to mi tworzy w ogole pole jako VARCHAR :/
edit:
ok, trzeba niby dodac
* @ORM\JoinColumn(name="grid_type_id", referencedColumnName="id", nullable=false)
ale to mi pluje zapytaniem i bledem
Cytat
[Doctrine\DBAL\DBALException]
An exception occurred while executing 'ALTER TABLE grids CHANGE grid_type_id grid_type_id INT NOT NULL':
SQLSTATE[22004]: Null value not allowed: 1138 Invalid use of NULL value
An exception occurred while executing 'ALTER TABLE grids CHANGE grid_type_id grid_type_id INT NOT NULL':
SQLSTATE[22004]: Null value not allowed: 1138 Invalid use of NULL value
edit2: dobra... mialem wartosc null w rekordach to logiczne ze sie plulo...
