| @@ 289-301 (lines=13) @@ | ||
| 286 | return \Doctrine\ORM\EntityManager::create($conn, $config); |
|
| 287 | } |
|
| 288 | ||
| 289 | function createMigration(\Doctrine\DBAL\Connection $conn) |
|
| 290 | { |
|
| 291 | $config = new \Doctrine\DBAL\Migrations\Configuration\Configuration($conn); |
|
| 292 | $config->setMigrationsNamespace('DoctrineMigrations'); |
|
| 293 | $migrationDir = __DIR__.'/src/Eccube/Resource/doctrine/migration'; |
|
| 294 | $config->setMigrationsDirectory($migrationDir); |
|
| 295 | $config->registerMigrationsFromDirectory($migrationDir); |
|
| 296 | ||
| 297 | $migration = new \Doctrine\DBAL\Migrations\Migration($config); |
|
| 298 | $migration->setNoMigrationException(true); |
|
| 299 | ||
| 300 | return $migration; |
|
| 301 | } |
|
| 302 | ||
| 303 | function initializeDatabase(\Doctrine\ORM\EntityManager $em) |
|
| 304 | { |
|
| @@ 487-499 (lines=13) @@ | ||
| 484 | return $em; |
|
| 485 | } |
|
| 486 | ||
| 487 | private function createMigration(Connection $conn) |
|
| 488 | { |
|
| 489 | $config = new Configuration($conn); |
|
| 490 | $config->setMigrationsNamespace('DoctrineMigrations'); |
|
| 491 | $migrationDir = $this->rootDir.'/src/Eccube/Resource/doctrine/migration'; |
|
| 492 | $config->setMigrationsDirectory($migrationDir); |
|
| 493 | $config->registerMigrationsFromDirectory($migrationDir); |
|
| 494 | ||
| 495 | $migration = new Migration($config); |
|
| 496 | $migration->setNoMigrationException(true); |
|
| 497 | ||
| 498 | return $migration; |
|
| 499 | } |
|
| 500 | ||
| 501 | private function dropTables(EntityManager $em) |
|
| 502 | { |
|