Entity sylius_address with new field


#1

Here is my entity with new field:

namespace AppBundle\Entity;

use Sylius\Component\Core\Model\Address as BaseAddress;
use Doctrine\ORM\Mapping as ORM;

/**
 * Blog
 *
 * @ORM\Table(name="sylius_address")
 */
class Address extends BaseAddress
{
    /**
     * @ORM\Column(type="text", nullable=true)
     */
    public $nip;

    public function getNip()
    {
        return $this->nip;
    }

    public function setNip($nip)
    {
        $this->nip = $nip;
    }
}

but command php bin/console doctrine:schema:update --force return info:
[OK] Nothing to update - your database is already in sync with the current entity metadata.

I suppose I’m missing configuration. Somebody knows ?


#2

Hi,

I think you have to override the model’s class in the app/config/config.yml.

There’s an example in :
http://docs.sylius.com/en/1.1/customization/model.html#how-to-customize-a-model


#3

You added ORM\Table but also you need to add @ORM\Entity annotation.