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