Skip to content

Commit

Permalink
bug #161 [Migration] Adjust namespace to newest Sylius Standard (lchr…
Browse files Browse the repository at this point in the history
…usciel)

This PR was merged into the 1.0-dev branch.

Discussion
----------

Despite the note: `Namespace is arbitrary but should be different from App\Migrations as migrations classes should NOT be autoloaded`, the current Sylius Standard configuration suggests `App\Migration` as a namespace(ref. https://github.com/Sylius/Sylius-Standard/blob/master/config/packages/doctrine_migrations.yaml#L6). What is more, this namespace is not an issue anymore: doctrine/DoctrineMigrationsBundle#242.

Without this change, current migration will not work automatically during plugin installation. 

Commits
-------

defb3b7 [Migration] Adjust namespace to newest Sylius Standard
  • Loading branch information
Zales0123 authored Nov 13, 2020
2 parents 8514115 + defb3b7 commit 45baae3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion etc/travis/sylius18/doctrine_migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ doctrine_migrations:
table_storage:
table_name: sylius_migrations
migrations_paths:
'Sylius\Migrations': '%kernel.project_dir%/src/Migrations/'
'App\Migrations': '%kernel.project_dir%/src/Migrations/'
2 changes: 1 addition & 1 deletion migrations/Version20200907102535.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Sylius\Migrations;
namespace App\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
Expand Down
2 changes: 1 addition & 1 deletion tests/Application/config/packages/doctrine_migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ doctrine_migrations:
dir_name: "%kernel.project_dir%/src/Migrations"

# Namespace is arbitrary but should be different from App\Migrations as migrations classes should NOT be autoloaded
namespace: Sylius\Migrations
namespace: App\Migrations
2 changes: 1 addition & 1 deletion tests/Application/src/Migrations/Version20200604080033.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Sylius\Migrations;
namespace App\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
Expand Down

0 comments on commit 45baae3

Please sign in to comment.