2
votes

I am trying to update my database schema without passing from symfony structure. php bin/console doctrine:schema:update --force

because am using doctrine inside a custom php application i have a static function that return the entity manager :

$paths = array("services/Entity");

$isDevMode = true;
// the connection configuration
$dbParams = array(
    'host'   => '',
    'port'   => '',
    'driver'   => '',
    'user'     => '',
    'password' => '',
    'dbname'   => '',
    'charset'   => 'UTF8',
);
$config = \Doctrine\ORM\Tools\Setup::createConfiguration($isDevMode,"cache/Proxies");
$driver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver(new \Doctrine\Common\Annotations\AnnotationReader(), $paths);

// registering noop annotation autoloader - allow all annotations by default
\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader('class_exists');
$config->setMetadataDriverImpl($driver);

//$entityManager = \Doctrine\ORM\EntityManager::create($dbParams, $config);
$entityManager = \Doctrine\ORM\EntityManager::create($dbParams, $config);
return $entityManager;

I am using annotations in my entities.

thanks

1

1 Answers

1
votes

You could find the command

$ vendor/bin/doctrine orm:schema-tool:update --force --dump-sql

in the doctrine's getting started guide.