I'm trying to create Many to Zero or One link in a Symfony/Doctrine entity. I think the following should work the trick:
/**
* @var integer
*
* @ORM\Column(name="vragenlijst_id")
* @ORM\ManyToOne(targetEntity="GroNed\AdminBundle\Entity\WalkthroughType")
* @ORM\JoinColumn(name="vragenlijst_id", referencedColumnName="id", nullable=true)
*/
private $vragenlijst;
However: Doctrine seems to disagree with me:
[bhillier@devserver-2 Symfony]$ php app/console doctrine:schema:update --dump-sql
ALTER TABLE walkthrough CHANGE vragenlijst_id vragenlijst_id INT NOT NULL;
I'm probably missing something stupid, but I can't see what at the moment. Has anyone got any ideas?
In case it helps:
[bhillier@devserver-2 Symfony]$ /usr/local/apache2/bin/apachectl -version
Server version: Apache/2.4.18 (Unix)
Server built: Jan 26 2016 06:31:19
[bhillier@devserver-2 Symfony]$ /opt/php-5.6/bin/php --version
PHP 5.6.17 (cli) (built: Jan 26 2016 05:36:55)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
[bhillier@devserver-2 Symfony]$ php app/console --version
Symfony version 2.6.13 - app/dev/debug