change migration namespace

This commit is contained in:
Julien Fastré 2021-03-02 17:15:47 +01:00
parent dca993834b
commit 061a024151
12 changed files with 45 additions and 9 deletions

View File

@ -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');

View 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;
}
}

View File

@ -0,0 +1,3 @@
---
services:
'Chill\MainBundle\Doctrine\Migrations\VersionComparator': ~

View File

@ -1,6 +1,6 @@
<?php
namespace Application\Migrations;
namespace Chill\Migrations\Main;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

View File

@ -1,6 +1,6 @@
<?php
namespace Application\Migrations;
namespace Chill\Migrations\Main;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

View File

@ -1,6 +1,6 @@
<?php
namespace Application\Migrations;
namespace Chill\Migrations\Main;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

View File

@ -1,6 +1,6 @@
<?php
namespace Application\Migrations;
namespace Chill\Migrations\Main;
use Doctrine\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;