mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
change migration namespace
This commit is contained in:
parent
dca993834b
commit
061a024151
@ -110,6 +110,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
|
||||
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../config'));
|
||||
$loader->load('services.yaml');
|
||||
$loader->load('services/doctrine.yaml');
|
||||
$loader->load('services/logger.yaml');
|
||||
$loader->load('services/repositories.yaml');
|
||||
$loader->load('services/pagination.yaml');
|
||||
|
32
Doctrine/Migrations/VersionComparator.php
Normal file
32
Doctrine/Migrations/VersionComparator.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\MainBundle\Doctrine\Migrations;
|
||||
|
||||
use Doctrine\Migrations\Version\Comparator;
|
||||
use Doctrine\Migrations\Version\Version;
|
||||
|
||||
use function strcmp;
|
||||
use function explode;
|
||||
|
||||
/**
|
||||
* Compare Version classes names from different namespaces and order them.
|
||||
*
|
||||
* Version are compared on the date's class.
|
||||
*/
|
||||
final class VersionComparator implements Comparator
|
||||
{
|
||||
private function getNumber(Version $version): string
|
||||
{
|
||||
$names = explode("\\", (string) $version);
|
||||
|
||||
return end($names);
|
||||
}
|
||||
|
||||
public function compare(Version $a, Version $b): int
|
||||
{
|
||||
$q = strcmp($this->getNumber($a), $this->getNumber($b));
|
||||
|
||||
return $q;
|
||||
}
|
||||
}
|
||||
|
3
config/services/doctrine.yaml
Normal file
3
config/services/doctrine.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
services:
|
||||
'Chill\MainBundle\Doctrine\Migrations\VersionComparator': ~
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
namespace Chill\Migrations\Main;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
Loading…
x
Reference in New Issue
Block a user