File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -348,17 +348,21 @@ Now update your ``cli-config.php`` in the root of your project to look like the
348
348
require 'vendor/autoload.php';
349
349
350
350
use Doctrine\ORM\EntityManager;
351
- use Doctrine\ORM\Tools\Setup ;
351
+ use Doctrine\ORM\ORMSetup ;
352
352
use Doctrine\Migrations\Configuration\EntityManager\ExistingEntityManager;
353
353
use Doctrine\Migrations\DependencyFactory;
354
+ use Doctrine\Migrations\Configuration\Migration\PhpFile;
355
+ use Doctrine\DBAL\DriverManager;
354
356
355
357
$config = new PhpFile('migrations.php'); // Or use one of the Doctrine\Migrations\Configuration\Configuration\* loaders
356
358
357
359
$paths = [__DIR__.'/lib/MyProject/Entities'];
358
360
$isDevMode = true;
359
361
360
- $ORMconfig = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
361
- $entityManager = EntityManager::create(['driver' => 'pdo_sqlite', 'memory' => true], $ORMconfig);
362
+ $ORMConfig = ORMSetup::createAttributeMetadataConfiguration($paths, $isDevMode);
363
+ $connection = DriverManager::getConnection(['driver' => 'pdo_sqlite', 'memory' => true]);
364
+
365
+ $entityManager = new EntityManager($connection, $ORMConfig);
362
366
363
367
return DependencyFactory::fromEntityManager($config, new ExistingEntityManager($entityManager));
364
368
You can’t perform that action at this time.
0 commit comments