Skip to content

Commit

Permalink
Fixed migrations diff
Browse files Browse the repository at this point in the history
Signed-off-by: alexmerlin <[email protected]>
  • Loading branch information
alexmerlin committed Nov 20, 2024
1 parent 482f291 commit 8d6d8d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
16 changes: 7 additions & 9 deletions config/cli-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
use Doctrine\Migrations\DependencyFactory;
use Doctrine\ORM\EntityManager;

$container = require __DIR__ . '/container.php';
$container = require 'config/container.php';

$config = new PhpFile('config/migrations.php');

$entityManager = $container->get(EntityManager::class);

// register enum type for doctrine
$entityManager->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');

return DependencyFactory::fromEntityManager($config, new ExistingEntityManager($entityManager));
return DependencyFactory::fromEntityManager(
new PhpFile('config/migrations.php'),
new ExistingEntityManager(
$container->get(EntityManager::class)
)
);
12 changes: 4 additions & 8 deletions config/migrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@
declare(strict_types=1);

return [
'table_storage' => [
'table_storage' => [
'table_name' => 'migrations',
'version_column_name' => 'version',
'version_column_length' => 191,
'executed_at_column_name' => 'executed_at',
'execution_time_column_name' => 'execution_time',
],
'migrations_paths' => [
'migrations_paths' => [
'Admin\Migrations' => getcwd() . '/data/doctrine/migrations',
],
'all_or_nothing' => true,
'transactional' => true,
'check_database_platform' => true,
'organize_migrations' => 'none',
'connection' => null,
'em' => null,
'all_or_nothing' => true,
'transactional' => true,
];

0 comments on commit 8d6d8d4

Please sign in to comment.