mirror of
https://github.com/shlinkio/shlink.git
synced 2025-01-11 00:22:04 -06:00
Refactor cli-config file as it's currently used by doctrine migrations only
This commit is contained in:
parent
274c454fa4
commit
1d7c9fd553
@ -2,11 +2,29 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Doctrine\Migrations\Configuration\EntityManager\ExistingEntityManager;
|
||||||
|
use Doctrine\Migrations\Configuration\Migration\ConfigurationArray;
|
||||||
|
use Doctrine\Migrations\DependencyFactory;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
use Doctrine\ORM\Tools\Console\ConsoleRunner;
|
|
||||||
|
// This file is currently used by docrtrine migrations only
|
||||||
|
|
||||||
return (static function () {
|
return (static function () {
|
||||||
/** @var EntityManager $em */
|
/** @var EntityManager $em */
|
||||||
$em = include __DIR__ . '/entity-manager.php';
|
$em = include __DIR__ . '/entity-manager.php';
|
||||||
return ConsoleRunner::createHelperSet($em);
|
|
||||||
|
$migrationsConfig = [
|
||||||
|
'migrations_paths' => [
|
||||||
|
'ShlinkMigrations' => 'data/migrations',
|
||||||
|
],
|
||||||
|
'table_storage' => [
|
||||||
|
'table_name' => 'migrations',
|
||||||
|
],
|
||||||
|
'custom_template' => 'data/migrations_template.txt',
|
||||||
|
];
|
||||||
|
|
||||||
|
return DependencyFactory::fromEntityManager(
|
||||||
|
new ConfigurationArray($migrationsConfig),
|
||||||
|
new ExistingEntityManager($em),
|
||||||
|
);
|
||||||
})();
|
})();
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
'migrations_paths' => [
|
|
||||||
'ShlinkMigrations' => 'data/migrations',
|
|
||||||
],
|
|
||||||
'table_storage' => [
|
|
||||||
'table_name' => 'migrations',
|
|
||||||
],
|
|
||||||
'custom_template' => 'data/migrations_template.txt',
|
|
||||||
|
|
||||||
];
|
|
Loading…
Reference in New Issue
Block a user