Search code examples
symfonydoctrine-ormsymfony-3.2sulu

Symfony entity override "The table with name 'sulu_11.me_media' already exists


I am overriding entity of bundle.

In my bundle

I am writing an

namespace AppBundle\Entity;

use Sulu\Bundle\MediaBundle\Entity\Media as Base;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;

/**
 * @ORM\Table(name="me_media")
 * @ORM\Entity(repositoryClass="AppBundle\Repository\MediaRepository")
 */
class Media extends Base
{

}

And when i run command

php bin/console doctrine:schema:update --force

Error thrown while running command "doctrine:schema:update --force". Message: "The table with name 'sulu_11.me_media' already exists." ["error" => Doctrine\DBAL\Schema\SchemaException { …},"command" => "doctrine:schema:update --force","message" => "The table with name 'sulu_11.me_media' already exists."] [] [Doctrine\DBAL\Schema\SchemaException] The table with name 'sulu_11.me_media' already exists.


Solution

  • Have you added also the configuration for the new entity? You can find that in the documentation http://docs.sulu.io/en/latest/cookbook/extend-entities.html#configuration