2016-04-17 20:27:24 +02:00
|
|
|
<?php
|
2019-10-05 17:26:10 +02:00
|
|
|
|
2017-10-12 10:13:20 +02:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2023-06-23 09:16:33 +02:00
|
|
|
use Doctrine\Migrations\Configuration\EntityManager\ExistingEntityManager;
|
|
|
|
use Doctrine\Migrations\Configuration\Migration\ConfigurationArray;
|
|
|
|
use Doctrine\Migrations\DependencyFactory;
|
|
|
|
|
2023-07-01 16:33:52 +02:00
|
|
|
// This file is currently used by doctrine migrations only
|
2016-04-17 20:27:24 +02:00
|
|
|
|
2021-07-19 19:59:41 +02:00
|
|
|
return (static function () {
|
2023-06-23 09:16:33 +02:00
|
|
|
$migrationsConfig = [
|
|
|
|
'migrations_paths' => [
|
2024-01-02 17:55:23 +01:00
|
|
|
'ShlinkMigrations' => 'module/Core/migrations',
|
2023-06-23 09:16:33 +02:00
|
|
|
],
|
|
|
|
'table_storage' => [
|
|
|
|
'table_name' => 'migrations',
|
|
|
|
],
|
|
|
|
'custom_template' => 'data/migrations_template.txt',
|
|
|
|
];
|
2023-07-15 10:58:24 +02:00
|
|
|
$em = include __DIR__ . '/entity-manager.php';
|
2023-06-23 09:16:33 +02:00
|
|
|
|
|
|
|
return DependencyFactory::fromEntityManager(
|
|
|
|
new ConfigurationArray($migrationsConfig),
|
|
|
|
new ExistingEntityManager($em),
|
|
|
|
);
|
2019-10-05 17:26:10 +02:00
|
|
|
})();
|